aboutsummaryrefslogtreecommitdiffstats
path: root/php/upload.php
diff options
context:
space:
mode:
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";
+
+?>