From b4c345e6a5fa929ba20eac19183b9c777055f52d Mon Sep 17 00:00:00 2001 From: Gaspard Coulet Date: Wed, 28 Apr 2021 23:12:36 +0200 Subject: Initial commit --- javascript_network/upload.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 javascript_network/upload.php (limited to 'javascript_network/upload.php') diff --git a/javascript_network/upload.php b/javascript_network/upload.php new file mode 100644 index 0000000..3ab6b22 --- /dev/null +++ b/javascript_network/upload.php @@ -0,0 +1,37 @@ + 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."; + } +} +?> -- cgit v1.2.3