in reply to Re^3: Perl CGI to download files via web browser
in thread Perl CGI to download files via web browser
#!/usr/bin/perl #print "Content-type: text/html\n\n"; my $filepath='/upload/testing.pm'; print "Content-Type: text/html\n\n"; open("DOWNLOADFILE", "<".$filePath); while($fileContents = <DOWNLOADFILE>) { print $fileContents; } print "Content-Type: text\n"; print "Content-Disposition: attachement; filename='testing.pm'\n"; print "Content-Description: File to download\n\n"; close DOWNLOADFILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Perl CGI to download files via web browser
by hippo (Archbishop) on Mar 08, 2013 at 18:12 UTC | |
by tanuj (Novice) on Mar 11, 2013 at 15:43 UTC |