500000) { echo "Sorry, your file is too large."; $uploadOk = 0; } if($imageFileType != "nn" ) { echo "Sorry, only .nn files are allowed."; $uploadOk = 0; } if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; header("Refresh:0"); } else { echo "Sorry, there was an error uploading your file."; } } ?>