Reputation:
I want to check if the user has selected an image for upload. What is the php script to do that after the user has clicked submit...
I tried file_exist(), but that expects a string rather than an array and it seems that only works for an absolute path. Since I don't know which folder the user is going to upload from, this doesn't work.
Can someone help?
Upvotes: 0
Views: 477
Reputation: 163272
Take a look at the $_FILES
superglobal.
Tizag Tutorial: http://www.tizag.com/phpT/fileupload.php
If you do a print_r($_FILES)
, you will see everything you need.
Upvotes: 3