Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: File Upload Problem

by Snuggle (Friar)
on Jul 02, 2002 at 15:34 UTC ( #178884=note: print w/replies, xml ) Need Help??


in reply to File Upload Problem

The parameter returned in multipart form data when accessed the first time is the filename of the file uploaded (like you said, JUST the filename). You need to ensure that you are eliminating illegal characters, usually with a RegEx of some type. Then you can execute something like this:
while (my $bytesread = read($file, my $buffer, 1024)) { print OUTFILE $buffer; }

to get the actual data from the file (you have to have defined OUTFILE, usually as the filename you just got from the form parameter). There isn't a real way to get multipart form data to send you the full path to the file on the users computer, nor do you need it.

Check out this node for more great info.

Anyway, no drug, not even alcohol, causes the fundamental ills of society. If we're looking for the source of our troubles, we shouldn't test people for drugs, we should test them for stupidity, ignorance, greed and love of power.

--P. J. O'Rourke

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2022-12-05 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?