Upload Image using App42 upload service

0 votes

Hello,

I am trying to upload an image using App42 upload service. But I am not able to do so.
Basically, what I am doing, I had created a form on in which I accept an image to be uploaded. But I am not able to upload the file on the App42.
so can you explain to me what "Your local file path" refer to cause I had tried to upload from the local file path, but I got an exception 400 The Request parameters are invalid. The parameter 'File' cannot be null or empty
 

  1. $fileName = "<Your_file_name>";     
  2. $fileType = "<Your_file_type>";     
  3. $filePath = "Your Local File Path";   
  4. $description = "File Description";
asked Feb 17, 2018 in PHP by krishnji.axovel (11 points)
And I have also check the file using file_exits() which returns true. But still I am getting this error
So can you suggest what is going wrong in this.
Kindly, revert to this ASAP.

1 Answer

0 votes
Hi,

Could you please share the code snippet which is giving this exception? It will help us to understand the problem in better way.

Thanks.
answered Feb 18, 2018 by rajeev.etc (1,660 points)
I am using for PHP package in a laravel project
And following is the code that I am testing and I am getting the error
I had added a static path from my file directory path for the test for the test.

$logo = $request->file('logo');
            $file2 = md5(uniqid(rand(), true));
            $extension = $logo->getClientOriginalExtension();
            $logo_name = $file2;
            $upload = self::$uploadService->uploadFile($logo_name, "C:\\test.jpg", UploadFileType::IMAGE, $input['eventName']."_logo");

And let me know where I am doing it wrong
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...