Amit Patil
Amit Patil

Reputation: 3067

drag drop file upload with file api server side code

I am trying to make drag drop file upload using FILE api and folowing this tutorial

https://developer.mozilla.org/en/Using_files_from_web_applications

its works fine. when i see ajax request "POST" data with firebug i see something like this

--30000 Content-Disposition: form-data; name='fileId'; filename='header.jpg' Content-Type: application/octet-stream ÿØÿà �JFIF��H�H��ÿÛ�C�    $.' ",#(7),01444'9=82<.342ÿÛ�C  

How can i save this data in a image format at server end ??

You can check live demo @ http://www.amitpatil.me//demos/in_progress/gmail_fupload/file.html

Upvotes: 0

Views: 724

Answers (1)

devOp
devOp

Reputation: 3180

You need to use the global $_FILES. It contains all the information about the uploaded Data. Have a look at http://www.php.net/manual/en/features.file-upload.post-method.php. In your case you will get the tmp. uploaded-file by using $_FILES['fieldID']['tmp_name'].

Upvotes: 1

Related Questions