in reply to Saving submitted files

See uploading a file and related items in Super Search for instructions on how to do this with the CGI.pm module.

You don't need to know the path on the client or even the IP address of the client. If the client's user agent is working properly, it will encode and POST the file to the server. CGI.pm provides mechanisms to access the uploaded file safely and sanely.

Replies are listed 'Best First'.
Re: Re: Saving submitted files
by Ido (Hermit) on Mar 02, 2001 at 16:21 UTC
    I think you must have  <form ... enctype="multipart/form-data"> in the HTML form in order to make the client's user agent encode the form, including the file's contents, in the multipart/form-data encoding. And then CGI.pm will help parsing it.
    use CGI; my $q=new CGI; my $file=$q->param('foo'); #foo is the name of the file field in the f +orm print "You uploaded $file:"; #$file is the name of the file print <$file>; #and it can also be used as a file handle to get the co +ntents of the file