6

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?

Community
  • 1
  • 1
lafncow
  • 405
  • 5
  • 8
  • 2
    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. – lafncow Dec 29 '11 at 19:04
  • I wonder if it would be possible to force IE to bring this into the iframe by explicitly setting the disposition to inline. Will try this. – clacke May 07 '12 at 04:52
  • Have you tried doing a GET instead of a POST? – redolent Aug 16 '12 at 18:05

1 Answers1

4

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, and multipart/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 the XDomainRequest object more difficult than it would be otherwise.

References

Community
  • 1
  • 1
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265