aboutsummaryrefslogtreecommitdiffstats
path: root/php/upload.php
diff options
context:
space:
mode:
authoradam <adam@>2021-01-28 18:16:41 +0200
committeradam <adam@>2021-01-28 18:16:41 +0200
commit9cab0d0ed64f4e5289a0c979cae10a92508c391b (patch)
tree49fafe0e0067b7aa394a08556bda611bfdfe4c58 /php/upload.php
parentceedd596c9f39f53555fd0746a42d6b85cd49b6c (diff)
downloadfileup-9cab0d0ed64f4e5289a0c979cae10a92508c391b.tar.gz
initial registering stuff
Diffstat (limited to 'php/upload.php')
-rw-r--r--php/upload.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/php/upload.php b/php/upload.php
new file mode 100644
index 0000000..93fa778
--- /dev/null
+++ b/php/upload.php
@@ -0,0 +1,23 @@
+<?php
+
+if (!array_key_exists('uf', $_FILES)) {
+ http_response_code(400);
+ exit();
+}
+
+
+$file = $_FILES['uf'];
+
+
+if (file['error'] != 0) {
+ http_response_code(400);
+ exit();
+}
+
+$m = md5_file($file['tmp_name']);
+
+copy($file['tmp_name'], "screen/$m.png");
+
+echo "http://india.fmi.fail/screen/$m.png";
+
+?>