core_files_upload - Image upload issue using web service

core_files_upload - Image upload issue using web service

by Deepak Kumar -
Number of replies: 0

Hello All

I am having issue while uploading user image from web service  

  $imagename = $_FILES["image"]["name"];
   $filepath = '/'; 

$params = array( 'component' => 'user','filearea' => 'draft', 'itemid' => 2,'filename' => $imagename,'filepath' => '/','filecontent' => base64_encode($imagename), 'contextlevel' => 'user', 'instanceid' =>2);  

When I post , I got this response

{"contextid":5,"component":"user","filearea":"draft","itemid":2,"filepath":"\/","filename":"Sym_Visited_300dpi.png","url":"http:\/\/mywebsite.com\/draftfile.php\/5\/user\/draft\/2\/Sym_Visited_300dpi.png"}

However when I download the image from above url its giving invalid image .

Is there anyone who can help?

Thanks
Deepak

Average of ratings: -