How do I do it? These don't work:
if(empty($_FILES)){
echo "there is no file uploaded";
exit;
} else {
echo "there is file";
}
if(sizeof($_FILES)!=0){
echo "there is file";
} else {
echo "there is no file";
}
How do I do it? These don't work:
if(empty($_FILES)){
echo "there is no file uploaded";
exit;
} else {
echo "there is file";
}
if(sizeof($_FILES)!=0){
echo "there is file";
} else {
echo "there is no file";
}
From: http://php.net/manual/en/reserved.variables.files.php
"If $_FILES is empty ... try adding
enctype="multipart/form-data"
to the form tag and make sure you have file uploads turned on."you can use is_array($_FILES) to check if it contains files info in array format or not
Try
Sample :
You can see more examples here http://php.net/manual/en/function.move-uploaded-file.php