IE9 JSON Data To Iframe: "Do you want to open or save this file?"

I have the same problem as explained here , in short:

I use iframe to send files to the AJAX server-style, and then get a JSON response to tell me if the file was downloaded and successfully parsed. This works great in every browser except IE9. Instead, IE9 offers me to save or open JSON and not pass it back to the iframe.

In another SO question for this, EricLaw -MSFT suggested setting the content type to "application / json", which I did, but to no avail.

Does anyone know how to get IE9 to let iframe have its JSON?

+6
source share
1 answer

Well, it seems that setting the content type to "text / html" does the trick. It is less than ideal as it does not describe the content, but good. Hope this helps someone else too.

HTML forms are limited to sending data in three different types of content: text/plain , application/x-www-form-urlencoded and multipart/form-data

To work around this problem, the server code that is currently processing HTML forms must be rewritten to manually parse the request body into name / value pairs when receiving requests from XDomainRequest objects. This makes it easier to add support for the XDomainRequest object than it would otherwise.

References

+4
source

Source: https://habr.com/ru/post/904683/


All Articles