From 7ffc77710590d6b9dec685aa94160b10e7dcb0d8 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 21 Sep 2014 12:20:11 +0100 Subject: Provide example upload form and submission files --- upload.html | 4 ++++ upload_file.php | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 upload.html create mode 100644 upload_file.php diff --git a/upload.html b/upload.html new file mode 100644 index 0000000..cdc49a1 --- /dev/null +++ b/upload.html @@ -0,0 +1,4 @@ +
+ +
+Different formats: Plain text, lightweight or JSON! Specify date ranges! Only show the last X files! Ranges work with any format. diff --git a/upload_file.php b/upload_file.php new file mode 100644 index 0000000..09f2bd7 --- /dev/null +++ b/upload_file.php @@ -0,0 +1,64 @@ + + + + + + +Upload result + + +

+= $sys['size'] && $i < $depth) { + $size /= $sys['size']; + $i++; + } + + return sprintf($retstring, $size, $sys['prefix'][$i]); +} + + { + if ($_FILES["file"]["error"] > 0) + { + echo "Return Code: " . $_FILES["file"]["error"] . "
"; + } + else + { + if (file_exists($_FILES["file"]["name"])) + { + echo "Error: " . $_FILES["file"]["name"] . " already exists. "; + } + else + { + move_uploaded_file($_FILES["file"]["tmp_name"], + "./" . $_FILES["file"]["name"]); + echo "Uploaded: " . $_FILES["file"]["name"] . "
"; + $fileurl = "$url" . $_FILES["file"]["name"]; + echo "URL: $fileurl
"; + echo "Size: " . size_readable($_FILES["file"]["size"], null, "bi"); + } + } + } +?> +

+

+Back to index +

+ + -- cgit v1.2.3