irene79
asked on
Uploading File
How can i check whether user did specify a file b4 clicking "Upload"? im not using any client-side scripting, so im using perl to check at the server end.
$ret = &ReadParse(\%cgi_data,\%cg i_cfn,\%cg i_ct,\%cgi _sfn);
this gave me a temp file everytime i click on upload .. even though the user did not specify any file to upload.
i also need to prompt user if the file they specify does not exist at all. Thanks!
$ret = &ReadParse(\%cgi_data,\%cg
this gave me a temp file everytime i click on upload .. even though the user did not specify any file to upload.
i also need to prompt user if the file they specify does not exist at all. Thanks!
ASKER
ermm can i have the exact code please?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am assuming that you are talking about using the FILE input form type.
Let's say you have the following html form input tag:
<input type=file name=upload_file>
In you perl script if you check for
the existense of the upload_file paramter, you can tell if any file name was entered. You can also do a -s on the temp filename in an if statement to find out if the uploaded file has a size greater than zero.
That should cover both of your questions.