> > All, > > I am a total n00b to perl and have decided to write my own file upload > script for a task I have to do. It is my intention to use CGI to accomplish > to allow users to upload a file through a webpage. I do not quite understand > the process, and thought it would be similar to the php function copy, but > this appears not to be the case. Can someone point me in the right direction > or help me to understand how this is supposed to work. > > Thanks in advance. > > John >
Check out the 'upload' method of the CGI module. http://search.cpan.org/~lds/CGI.pm-3.05/CGI.pm#CREATING_A_FILE_UPLOAD_FIELD In the above the first part of the section is about creating a file upload field in a form, which you may be able to skip if you are not generating the form dynamically. The second part explains how to receive a file and store it locally using the CGI.pm methods. You will need to include enctype="multipart/form-data" As a form attribute in your form (if you are not generating it dynamically with CGI). You may want to read through the rest of that doc to learn what other goodies CGI.pm provides. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>