ajax upload cannot process JSON response or gives download popup
- by Jorre
I'm using the AJAX plugin from Andris Valums:
AJAX Upload ( http://valums.com/ajax-upload/ )
Copyright (c) Andris Valums
It works great, except for the fact that I cannot send proper JSON as a response.
I'm setting the headers to 'Content-Type', 'application/json' before sending the JSON-encoded response, and in the plugin I'm saying that I'm expecting JSON:
responseType: "json",
This gives me a download popup asking to download the JSON/REPONSE file.
The strange thing is, when I don't ass the correct "Content-Type" to my response, it works.
Of course I want to pass the correct response type, because all my jQuery 1.4 calls are depending on correct JSON.
Does anyone else have had this same problem or is there anyone out there willing to try this out ?
I'd love to use this plugin but only when I can return proper JSON with the correct content-type
Thanks for all your help!