in reply to Fil Upload Problem
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 :)<form method="post" action="somescript.cgi" enctype="multipart/form-da +ta"> <input type="file" name="file">
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 |