in reply to file upload question

It doesn't "upload to a specified directory". It uploads to a temporary directory, and CGI then passes you a file handle. You can use that filehandle to copy the file to the "specified directory".

Replies are listed 'Best First'.
Re: Re: file upload question
by grahm (Novice) on May 05, 2004 at 17:05 UTC
    Thanks for your reply matija! Here's more background on the situation.. I have a little uploader script that I wrote to upload files to my server. It works fine until I try larger files and I'm assuming the script is timing out after 5 or so minutes. My host told me that the reason it's "crashing" on larger uploads is because I'm uploading to a "temp" directory and the servers see this as a dead link after a period of time. They said that if I were uploading to another designated directory, then this wouldn't happen. Any thoughts?

      Check out the docs for CGI (perldoc CGI), search specifically for the string upload. This should give you some information as to how the CGI module works for file uploads.

      --MidLifeXis

        Thanks again.. cpan.org offered the following, Ordinarily it spools the uploaded file to a temporary directory, then deletes the file when done. and The temporary directory is selected using the following algorithm. I probably don't want to be messing with Perl and its temp directory or spool. :)