350000){ echo "Your file is too large.
"; $ok=0; } //check if upload is an image (exif returns positive integer if it is) if(!exif_imagetype($_FILES['uploaded']['tmp_name'])){ echo "Your file isn't an image.
"; } //Here we check that $ok was not set to 0 by an error if ($ok==0){ echo "Sorry your file was not uploaded"; } //If everything is ok we try to upload it else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } } ?>