Hi,
I use File Upload Server - Upload File in PHP
What is the content of $filePath ?
filePath - The local path for the file.
I tried "C:\\Users\\username\\Desktop\\che.jpg", "C:/Users/username/Desktop/che.jpg", "file:///C:/Users/username/Desktop/che.jpg" and web url
I got the same result
Error Message :File Not Found
Error AppErrorCode :
Error HttpErrorCode :
this is my code
class uploadtest
{
public function uploadtest() {
$this->sp = new ServiceAPI("XXXXXXXXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXXXXX");
}
/******* upload file *******/
public function UploadFile() {
try
{
$uploadService = $this->sp->buildUploadService();
$fileName = "UploadTest01";
$fileType = "Upload.IMAGE";
$filePath = "C:/Users/username/Desktop/che.jpg";
$description = "File Description Flow";
$upload = $uploadService->uploadFile($fileName, $filePath, $fileType, $description);
print_r("fileName is " . $upload->getFileList()->getName()."<br/>");
print_r("fileType is " . $upload->getFileList()->getType()."<br/>");
$jsonResponse = $upload->toString();
print_r($jsonResponse);
}
catch(App42Exception $ex)
{
print_r("Error Message :".$ex->getMessage()."<br/>");
print_r("Error AppErrorCode :".$ex->getAppErrorCode()."<br/>");
print_r("Error HttpErrorCode :".$ex->getHttpErrorCode()."<br/>");
}
}
}
$mytest = new uploadtest;
$mytest -> UploadFile();
What is the content of $filePath ?
Please help me !
Thank you !