Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Improving a File Download Script

by neosamuri (Friar)
on Oct 13, 2005 at 06:43 UTC ( [id://499786]=note: print w/replies, xml ) Need Help??


in reply to Improving a File Download Script

As mentioned before you sould sure binmode, but I believe you should also use read like this:
open(DLFILE, "<$file_location/$id") || Error('open', 'file'); binmode print "Content-Type:application/x-download\n"; print "Content-Disposition: attachment;filename=$filename[0]\n\n"; my $data; while (read DLFILE, $_, 1024) { print $data; }
close (DLFILE) || Error ('close', 'file');

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-19 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found