in reply to Content-Disposition... odd behavior in IE

I don't have IE to test with, but based on a Google search the following has a good chance of fixing it.
#!/usr/bin/perl use strict; print "Content-type: application/octet-stream\n"; print "Cache-Control: private\n"; print "Content-disposition: attachment; filename=big-test.csv\n\n"; print "Test,One,Two,Three\n"; exit;
(This is based on this experience someone else had.)

Replies are listed 'Best First'.
Re^2: Content-Disposition... odd behavior in IE
by Rodster001 (Pilgrim) on Jan 14, 2009 at 18:22 UTC
    No dice :(

    The Cache-Control header didn't change a thing. But it does seem to be something to do with the cache. Almost like IE is deleting the file immediately after it creates it.

      Perhaps capitalization matters?
      #!/usr/bin/perl use strict; print "Content-type: application/octet-stream\n"; print "Cache-Control: private\n"; print "Content-Disposition: attachment; filename=big-test.csv\n\n"; print "Test,One,Two,Three\n"; exit;
      Update: And if that doesn't work, perhaps
      #!/usr/bin/perl use strict; print "Pragma: \n"; print "Cache-Control: \n"; print "Content-Disposition: attachment; filename=\"big-test.csv\"\n"; print "Content-type: application/octet-stream\n\n"; print "Test,One,Two,Three\n"; exit;
      (It is frustrating that I can't test these suggestions, but I don't have IE to test with and it is a browser issue.)

        Perhaps capitalization matters?

        Capitalisation is not suppose to matter for HTTP header names (but you never know), and you already rely on the case-insensitivity (by using "Content-type" instead of "Content-Type").

        Still no luck.

        After playing around with the cache idea in mind, I have noticed if the helper app is open the file opens sometimes (worked with Excel, but not Acrobat).

        This is confirmed with looking for files created in the cache folder.

        IE is either deleting or not creating the file in the cache.