Page 1 of 1

detecting file upload

Posted: Mon Oct 21, 2002 10:10 pm
by Zoram
Right now i have :

Code: Select all

if (isset($_FILESї'userfile']))
to detect if the file was sent... but it does the action even if the field is blank when they submit... How do i make it so that if they don't select a file to upload it doesn't do the action?

Posted: Mon Oct 21, 2002 10:26 pm
by mr_griff
Try this function...

Code: Select all

is_uploaded_file($HTTP_POST_FILESї'uploadFile']ї'tmp_name'])