There are quite a lot of things to understand and we can't help unless you tell us which pieces you need help with!use CGI; my $html= new CGI; #get the file name from URL ex. http://<server_IP>/cgi-bin/download.cg +i?a=testing.txt my $file= $html->param('a'); # $file is nothing but testing.txt my $filepath= "/var/www/upload/$file"; print ("Content-Type:application/x-download\n"); print "Content-Disposition: attachment; filename=$file\n\n"; open FILE, "< $filepath" or die "can't open : $!"; binmode FILE; local $/ = \10240; while (<FILE>){ print $_; } close FILE; # use Unlink if u want to delete the files after download. #unlink ($filepath);
In reply to Re: Download file to browser
by TheloniusMonk
in thread Download file to browser
by david.woosley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |