perlperl
asked on
file
file upload...i m trying to upload client's file on server
#!c:/perl/bin/Perl.exe
use CGI;
print "Content-type: text/html; charset=iso-8859-1\n\n";
$|=1;
print "Upload File.........\n";
$query = new CGI;
$filename = $query->param("upload_file ");
print "$filename : <br>";
$filename =~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("upload_fil e");
$upload_dir = "C:\\file.txt";
open UPLOADFILE, ">$upload_dir";
#binmode UPLOADFILE;
while ( <$upload_filehandle> )
{
print UPLOADFILE;
}
close UPLOADFILE;
it does create the file c:\file.txt on server, but the file is empty, when menas the script is not able to read clients file...
Any ideas, why?
is it due to some apache configuration?
#!c:/perl/bin/Perl.exe
use CGI;
print "Content-type: text/html; charset=iso-8859-1\n\n";
$|=1;
print "Upload File.........\n";
$query = new CGI;
$filename = $query->param("upload_file
print "$filename : <br>";
$filename =~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("upload_fil
$upload_dir = "C:\\file.txt";
open UPLOADFILE, ">$upload_dir";
#binmode UPLOADFILE;
while ( <$upload_filehandle> )
{
print UPLOADFILE;
}
close UPLOADFILE;
it does create the file c:\file.txt on server, but the file is empty, when menas the script is not able to read clients file...
Any ideas, why?
is it due to some apache configuration?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
but where exactly are you redirecting the page...i mean theris nothing like "action = blah...cgi"
ASKER
i got it
print $query->start_multipart_fo rm(-action =>"hkshfk. cgi"),
print $query->start_multipart_fo
ASKER
but how do i create the fancy html like tables....initially my form elements were in tables
ASKER
print "Content-type: text/html; charset=iso-8859-1\n\n"; to read the clients file (just guessing....)
because right now its not even going in the while loop