Think about Loose Coupling | |
PerlMonks |
Returning a CSV file from CGIby willdooUK (Beadle) |
on Sep 17, 2001 at 21:43 UTC ( [id://112911]=perlquestion: print w/replies, xml ) | Need Help?? |
willdooUK has asked for the wisdom of the Perl Monks concerning the following question:
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
Back to
Seekers of Perl Wisdom
|
|