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
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |