Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Uploading files using cgi.pm

by cfreak (Chaplain)
on Nov 29, 2001 at 22:17 UTC ( [id://128424]=note: print w/replies, xml ) Need Help??


in reply to Uploading files using cgi.pm

You don't need a filehandle, rather you need to use the read statement. So rather than what you have here:
while(<$formdata{upload}>) { print; }

Change that to:
my $buffer; while(read $formdata{upload},$buffer,1024) { print $buffer; }

you can also limit the size of the image being uploaded:
my $buffer; my $max_size = 10 * 1024; # 10 KB but it can be whatever my $size; while(read $formdata{upload},$buffer,1024) { $size += 1024; if($size > $max_size) { print "Image is too big!"; last; } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found