Hi,
I try to upload a file form Windows station to a Linux server via a Web application programmed in Perl/CGI.
I use a form to upload a file named c:\pp\tata.txt (it exists in Windows station). But if I change the name of the file to c:\pp\tata1.txt (it does not exist in Windows station), the application uploads the wrong file c:\pp\tata1.txt to the Linux server as aempty file.
I try to avoid this issue by testing if the wrong file exists or not, if it does not exist, it will display an error message "File does not exist". But it does not work fine. I get the error message in both situations, the file exists or does not exist, like this message:
=================================
File c:\pp\tata.txt does not exist
=================================
What is it wrong with my script? Thanks
Here is a prt of the script:
=============
$fpath=$q->param('upfile');
if ( ! -e "$fpath"){
print "File $fpath does not exist";
return;
}
I try to upload a file form Windows station to a Linux server via a Web application programmed in Perl/CGI.
I use a form to upload a file named c:\pp\tata.txt (it exists in Windows station). But if I change the name of the file to c:\pp\tata1.txt (it does not exist in Windows station), the application uploads the wrong file c:\pp\tata1.txt to the Linux server as aempty file.
I try to avoid this issue by testing if the wrong file exists or not, if it does not exist, it will display an error message "File does not exist". But it does not work fine. I get the error message in both situations, the file exists or does not exist, like this message:
=================================
File c:\pp\tata.txt does not exist
=================================
What is it wrong with my script? Thanks
Here is a prt of the script:
=============
$fpath=$q->param('upfile');
if ( ! -e "$fpath"){
print "File $fpath does not exist";
return;
}