[thelist] Async uploads and response content type for json

Bill Moseley moseley at hank.org
Mon Nov 15 13:45:52 CST 2010

I have a file upload that uses the hidden iframe appraoch.  The twist is
that the response to the upload will return json (details about the upload).

Currently, I have code that renders json and sets the appliation/json
content-type and that is used for all other AJAX requests.  But for the
upload, if the content type comes back as application/json then the browser
will prompt to save the "file", so the work-around seems to be to return a
text/* type of content type.

My question is this:  is it possible to return a correct content type
(applcation/json) and not have browsers ask to save?  In other words, is
there a better approach than using an incorrect text/* content type?

Bill Moseley
moseley at hank.org

More information about the thelist mailing list