Hi - I have a csv file sitting in a directory that only my CGI script can see. This is good, 'cos it means that it can't be got at from a web browser.
I want to let the sales team get at the file, so I'm writing an HTML page which submits a password to a simple CGI script. The script should check the password is OK, then return the CSV file.
However:
What I'd like to happen is for the browser to pop up a 'save as' dialogue box, and let the user save the file. This is what would happen if I gave the users the direct URL of the file.
At the moment, I can only manage to get the script to print it out to the browser, so the content appears as a web page.
Can I get the CGI to not splurge it out to the page? Change the header type maybe? I guess it has something to do with the perceived MIME type.
Any help is much appreciated.
willdooUK
--------------
"Home is a castle you built in my mind; I'm home anywhere, anytime."
Donny Hathaway
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.