in reply to Fil Upload Problem

Here's a couple of guesses: The last one can directly cause the problem you've mentioned. Typically, when you have an input type of file, the form tag and input tag should look something like the following:
<form method="post" action="somescript.cgi" enctype="multipart/form-da +ta"> <input type="file" name="file">
The enctype in this case specifies that the form data be sent in MIME format. This is the ONLY way that your system can parse out the upload contents. However, the value associated with the parameter "file" is something like "C:\windows\desktop\somefile.txt". Trying to open this filehandle directly when using strict will actually kill your script. However, if you try to open the filehandle directly on a local machine without strict, you'll actually get the file you are looking for, because Perl finds the path to the file. CGI.pm actually takes the file and stores it on the server and returns the param as a filehandle to the stored file. (I know I didn't explain this well, I'm a bit tipsy :)

See this node for a file upload script that I fixed up for another Monk. It may help you get started in the right direction.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

Replies are listed 'Best First'.
RE: (Ovid) Re: Fil Upload Problem
by Caillte (Friar) on Oct 27, 2000 at 13:57 UTC
    I did a lot of similar programs for a client recently. The biggest reason for an upload not happening IMHO is the last one you suggested. Without the enctype tag most browsers are unsure just what to pass and seem to just pass the filename as a text string. While this may be what you want in some cases, it wont be in most.