Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Upload stuff to server

by snadra (Scribe)
on Aug 14, 2003 at 10:28 UTC ( #283813=note: print w/ replies, xml ) Need Help??


in reply to Upload stuff to server

When you are uploading a file via an HTML form you can access this file using CGI.pm.
If you are creating the HTML with CGI as well, the upload field can be created like this:

print $query->filefield(-name=>'uploaded_file', -default=>'starting value', -size=>50, -maxlength=>80);
Usually these files are uploaded into a temoporary directory. CGI.pm deletes them automatically from the tmp dir after processing.
Access the file like this:
$filename = $query->param('uploaded_file'); $type = $query->uploadInfo($filename)->{'Content-Type'}; # or $fh = $query->upload('uploaded_file'); while (<$fh>) { print; }


Comment on Re: Upload stuff to server
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (13)
As of 2015-07-31 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (277 votes), past polls