0

A client is running into this problem when they try to hit a page that processes their credit card. This is the only person running into this issue, so I have to assume it's an IE specific problem or a Windows IE issue.

I'm not sure if this is a MIME type problem though. A PHP script shouldn't have its own type, correct? Since it can output binary data or text, it's up to the PHP script to return a Content-Type header. The only output from this process.php file is:

header('Content-Type: application/json');
die(json_encode($response));

Apparently this PHP script is called via Ajax. I'm not totally clear on why IE is trying to download it. Any help would be great!

PS: Unsure of IE version, finding out.

File download dialog in IE

Sampson
  • 265,109
  • 74
  • 539
  • 565
CaptSaltyJack
  • 15,283
  • 17
  • 70
  • 99
  • possible duplicate of [How can I convince IE to simply display application/json rather than offer to download it?](http://stackoverflow.com/questions/2483771/how-can-i-convince-ie-to-simply-display-application-json-rather-than-offer-to-do) – Daniel W. Jan 02 '15 at 22:02
  • I don't think this is a duplicate. That user is asking how to fix his own IE browser so he can debug. My problem is that I could potentially have tons of users with this problem, and I can't just ask them all to become technologically savvy and do a registry modification. – CaptSaltyJack Jan 02 '15 at 22:14
  • This only happens when you directly access the file. JSON is mostly used in ajax. Besides that, you cannot manipulate a client for security reason.... if the IE doesn't know that it should display the file, you cannot do anything. – Daniel W. Jan 02 '15 at 22:19
  • No, this is happening from an AJAX call. A user hits "pay" and it hits process.php via AJAX. This problem in IE should not be happening, but I need a way to fix it on the server side if possible. I can't tell my clients to stop using IE, unfortunately. – CaptSaltyJack Jan 02 '15 at 22:20
  • 2
    Remove the `Content-type` and it should work. And don't use `die()` for this. Use `echo`. – Ismael Miguel Jan 02 '15 at 22:41

0 Answers0