Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Problematic UploadFile() method in CGI.pm

by ahmad (Hermit)
on May 21, 2006 at 10:26 UTC ( [id://550771]=note: print w/replies, xml ) Need Help??


in reply to Problematic UploadFile() method in CGI.pm

Hello

First you'll need to get the file name to save it , *if you're planning to do so ... actually i cant see that you're saving anything in your code

# First -- Get file name from our File Box my $file = param('upload'); # Strip out file path from file name , to be able to save it out in ou +r server $file =~ s/.*[\/\\](.*)/$1/; # Next , Generate upload handle my $uph = upload("upload"); #now we save out our file using the name we already got open(OUT,">$file") or die $!; binmode(OUT); while(<$uph>){ print OUT $_; } close(OUT);

now you should see the same file in your server (uploaded)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://550771]
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: (4)
As of 2024-04-16 05:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found