From 90483f6eb389f041e0dbd0fca8bb766edbc85910 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 17 Mar 2022 21:02:13 +0800 Subject: +init --- upload.php | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 upload.php (limited to 'upload.php') diff --git a/upload.php b/upload.php new file mode 100644 index 0000000..ae9abbc --- /dev/null +++ b/upload.php @@ -0,0 +1,62 @@ + + 500000) { + // echoln( "Sorry, your file is too large."); + // $uploadOk = 0; + // } + + // Check if $uploadOk is set to 0 by an error + if ($uploadOk == 0) { + echoln( "Sorry, your file was not uploaded."); + // if everything is ok, try to upload file + } else { + if (move_uploaded_file($file["tmp_name"], $target_file)) { + //echoln( "The file ". htmlspecialchars( basename( $file["name"])). " has been uploaded."); + $uploadOk = 1; + } else { + $uploadOk = 0; + echoln( "Sorry, there was an error uploading your file."); + } + } + + return array($uploadOk, $target_file); + +} + +?> -- cgit v1.1-26-g67d0