I spent all of yesterday trying to upload a file via AJAX
only to read that it's not possible, without an iframe
or something else involved.

Where's the iFrame in Wichert's code?  Wichert, is it
specified in the action code?  action=/cms/addImage?

Or is $.ajaxSubmit able to handle files whereas $.ajax isn't?

Please shed some light...

Thanks,

Rick

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Mike Alsup
Sent: Friday, February 27, 2009 8:26 AM
To: jQuery (English)
Subject: [jQuery] Re: jquery.form fails to handle JSON responses with iframe
submit


> The form is correctly submitted to the server, which sends the right 
> JSON response back. But I never get that result: instead the browsers 
> pops up a window telling me it does not know how to handle 
> application/json and if I want to save the response. This is not quite 
> what I had in mind.

That happens because the file upload logic directs the server response to an
iframe.  If the response mimetype is application/json it will trigger the
issue you described in certain browsers.  If you drop that content-type
header on the response you should be fine.

Mike

Reply via email to