Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^6: Perl CGI to download files via web browser

by tanuj (Novice)
on Mar 11, 2013 at 15:43 UTC ( [id://1022816]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Perl CGI to download files via web browser
in thread Perl CGI to download files via web browser

Thanks for suggesting the solution ...I got the script working ...
use CGI; my $html= new CGI; my $file= $html->param('a'); 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; #unlink ($filepath);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1022816]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 03:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found