For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > May 2006 > How to check the file from CGI FORM









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to check the file from CGI FORM
Anish Kumar K.

2006-05-19, 3:58 am

HI

I uploaded a file from the HTML from through <input type="file"...>

and in the POST operation I am calling the perl file and in that I try
reading the file with the CGI variable and then write it into one location.

If I do any changes in the text box in the HTML, say I changed the file
name and clicked upload. The perl file is not checking whether the files
is present or not...

I did

if(-e $upload_file)
{
print "File Exists";
}
else
{
print "Not Exists";
}

In any case I am getting File Exists message. What should I do in the
perl file to check really whether the I file I entered in the file
upload box exists or not. As the PL is in the server and the file is the
local client machine..How come it do...//

Thanks
Anish


usenet@DavidFilmer.com

2006-05-20, 3:59 am

Anish Kumar K. wrote:
> The perl file is not checking whether the files is present or not...


I bet the Perl file is. But I think you and Perl disagree about what
the "file" is.

> I did
>
> if(-e $upload_file)
> {
> print "File Exists";
> }


Maybe ask Perl to give you a little more information, such as:

if(-e $upload_file) {
print "File '$upload_file' Exists";

Now what does Perl think $upload_file is? Does it exist on the
WEBSERVER?

--
http://DavidFilmer.com

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com