Greetings!

I am having some problems with IE and how it is handling the Content-Disposition header (I am not the first as it would seem).

When clicking a link in a web page with a CGI that returns the Content-Disposition header, IE will display a dialogue box "Save Open Cancel". Save works fine (saving the file and then opening works). Open, however will open the helper application but the file is always not found.

I have done some searching on the Net about this and found a few posted topics but no answers. Any ideas? Workarounds?

Here is a stripped down sample HTML page and CGI so you can reproduce the error and see for yourself.

test.html:

<a href="test.cgi">Download</a>

test.cgi:

#!/usr/bin/perl use strict; print "Content-type: application/octet-stream\n"; print "Content-disposition: attachment; filename=big-test.csv\n\n"; print "Test,One,Two,Three\n"; exit;

Note: For this error to be produced as I am explaining it, you need both the HTML and CGI file. Opening the CGI directly in IE produces different results. Also, the Content-type header can be omitted and produces the same results. I won't bother mentioning that this works fine in Firefox... oh, oops ;)

As always, thank you in advance for any enlightenment!


In reply to Content-Disposition... odd behavior in IE by Rodster001

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.