detecting file upload

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

detecting file upload

Post 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?
User avatar
mr_griff
Forum Commoner
Posts: 64
Joined: Tue Sep 17, 2002 11:11 am
Location: Bozeman, Montana

Post by mr_griff »

Try this function...

Code: Select all

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