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

Re: upload image with cgi

by Praveen (Friar)
on Sep 27, 2006 at 05:41 UTC ( [id://575084]=note: print w/replies, xml ) Need Help??


in reply to upload image with cgi

Try This.
#!/usr/bin/perl -w use CGI; $upload_dir = "/home/mywebsite/htdocs/upload"; $query = new CGI; $filename = $query->param("photo"); $filename =~ s/.*[\/\\](.*)/$1/; $upload_filehandle = $query->upload("photo"); open UPLOADFILE, ">$upload_dir/$filename"; binmode UPLOADFILE; while ( <$upload_filehandle> ) { print UPLOADFILE; } close UPLOADFILE;

Replies are listed 'Best First'.
Re^2: upload image with cgi
by Anonymous Monk on Mar 03, 2016 at 04:30 UTC
    This worked for me. Thank you.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-23 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found