in reply to Re^2: Perl CGI to download files via web browser
in thread Perl CGI to download files via web browser
One solution would be to load the file contents into memory and serve the content with the appropriate header. This of course depends on the size of the file, you don't want to load large files into memory and serve it like this. You could copy the file into a temporary web accessable area and provide a link to it.
Other things to consider, do you want to remove the converted file after you've sered it, so that you don't end up filling some filesystem with old files people have downloaded? Perhaps you'd need to write a housekeeping script to tidy up these files/areas on a regular basis. Clarify your requirements and consider the implications of your system. See also Print to Browser Headers Not Working Serve a file from a CGI script.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl CGI to download files via web browser
by tanuj (Novice) on Mar 08, 2013 at 14:22 UTC | |
by hippo (Archbishop) on Mar 08, 2013 at 18:12 UTC | |
by tanuj (Novice) on Mar 11, 2013 at 15:43 UTC |