It's a web based application, we're using ActiveState.

That's just a way to get Perl on Windows (and not the best one, IMHO).

when the Download button is clicked, we need to save the data into a comma delimited text file, but it's very important that the user can choose where to save the file

In general, web browsers can be asked to do "things", and you can suggest "things", but unlike with some specialized, proprietary clients, web browsers are free to ignore some or all of what you ask for and what you suggest.

Usually, websites suggest a filename for downloads. In the most trivial case, by just using a URL that ends in the desired name, e.g. http://www.example.com/some/where/desired-name.bin. In that case, there are no extra "instructions" for the web browser, and so the browser may choose to download the file or to display it, depending on its MIME type and sometimes also depending on the extension of the filename (".bin"). Using the Content-Disposition header, especially with the value attachment, a website may suggest to download the file EVEN IF the browser could also display it. (The browser is still free to ignore the C-D header, but most browsers follow its suggestion.) The C-D header may be extended by a filename attribute, suggesting a file name. If the browser chooses to accept the suggestion, it usually uses that in a "save as" dialog. Drive letters and directories in the filename attribute are usually removed. If there is no filename attribute, browsers usually fall back to extracting a filename from the URL.

You may try to avoid suggesting a filename, e.g. by using a URL ending in a "/" AND omitting the filename attribute for the C-D header.

If you have control over the user's browser choice (i.e. closed intranet instead of open internet), you can try to find and play tricks that work only with the selected browser.

Otherwise, you could ask on the website for a filename and use that in the download URL and/or the C-D header.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^3: pop up Save as box before downloading by afoken
in thread pop up Save as box before downloading by pearlgirl

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.