Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file upload

Status
Not open for further replies.

robdunfey

Technical User
Apr 26, 2002
110
GB
Hi, I was wondering if anyone has any ideas why my file upload code isnt working? The code makes the file in the appropriate folder, in this case a file called 'afile', but the file has no content?

Any help much appreciated,

Rob

PS I am uploading a file from a Windows machine to a UNIX server, I dont think this should make any difference?



#upload file
$upload_filehandle = $cgi->param("file1");


open UPLOADFILE, ">$projectdir/afile";

while (<$upload_filehandle>)
{
print UPLOADFILE;
}

close UPLOADFILE;
 
Rob,

Have a look at the FAQq's in this domain

Cheers
Paul
 
Check if you have enctype=&quot;multipart/form-data&quot; in your form tag.

Your form tag should look like this:

<form action=&quot;uploadscript.cgi&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top