blueimp/jQuery-File-Upload — Issue #797: Can I get a JSON response with the basic plug in ?
Author: LeChatNoir69
Created: 2011-11-17 16:53:12+00:00
State: open

Hi,
First, thank you so much for this plug in :-)

It just work for me except one thing.... I can't get a json response from the server. With the example you give, it's ok. The upload.php return a JSON response.

But in my code, I just use the fileupload.js (not the ui version) and the script always return text/plain back. I've even force the header to json/application but still not ok.
I need to use the response because the upload.php may have to change the "just" uploaded file name. I'd like to get the definitive name in the response.

So question is : does I have to use the UI version ?
If answer is Yes, I'll face to another pb : with the UI version, I got a "c.tmpl is not a function" javascript error....

Thanks for your help, sorry for my english (french people) and above, some details.
Hope you hear me :-)
Bye

Here is the response :
[{"name":"20111105_222600_0.jpg","size":699114,"type":"image\/jpeg","url":"\/opt\/local\/apache2\/htdocs\/modules\/photositetmp\/sandBox\/tmp\/20111105_222600_0.jpg","thumbnail_url":"\/opt\/local\/apache2\/htdocs\/modules\/photositetmp\/sandBox\/tmp\/thumbs\/20111105_222600_0.jpg","delete_url":"\/cgi-bin\/upload_photositetmp.php?file=20111105_222600_0.jpg","delete_type":"DELETE"}]

And the header (I've force it to json) :
Date	Thu, 17 Nov 2011 16:40:03 GMT
Server	Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/1.0.0c DAV/2 PHP/5.3.5
X-Powered-By	PHP/5.3.5
Pragma	no-cache
Cache-Control	private, no-cache
Content-Disposition	inline; filename="files.json"
X-Content-Type-Options	nosniff
Vary	Accept
Content-Length	383
Keep-Alive	timeout=5, max=77
Connection	Keep-Alive
Content-Type	application/json