I have the same issue as is explained here, in short:
I am using an iframe to post files to the server AJAX-style, then receiving a JSON response to tell me if the file was uploaded and parsed successfully. This works great is every browser except IE9. Instead, IE9 prompts me to save or open the JSON, and will not pass it back to the iframe.
In the other SO question for this, EricLaw -MSFT suggested to set the content type to "application/json", which I have done, but to no avail.
Does anyone know how to get IE9 to let the iframe have its JSON?
Well it looks like setting content type to "text/html" does the trick. It's less than ideal since it's not descriptive of the content, but oh well. Hope this helps someone else too.
HTML Forms are limited to sending data in three different content types:
text/plain
,application/x-www-form-urlencoded
, andmultipart/form-data
To workaround this issue, server code that currently processes HTML Forms must be rewritten to manually parse the request body into name-value pairs when receiving requests from
XDomainRequest
objects. This makes adding support for theXDomainRequest
object more difficult than it would be otherwise.
References
XDomainRequest - Restrictions, Limitations and Workarounds
HTML Living Standard: Association of controls and forms - The enctype and formenctype content attributes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With