]> _ Git - ccv-upload.git/commitdiff
wip #3462 @2.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 Jun 2020 14:18:06 +0000 (16:18 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 Jun 2020 14:18:06 +0000 (16:18 +0200)
.gitignore [new file with mode: 0644]
public/info.php [new file with mode: 0644]
public/upload.php [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..62e7820
--- /dev/null
@@ -0,0 +1,2 @@
+# Created by .ignore support plugin (hsz.mobi)
+.idea
\ No newline at end of file
diff --git a/public/info.php b/public/info.php
new file mode 100644 (file)
index 0000000..e974c40
--- /dev/null
@@ -0,0 +1 @@
+<?php phpinfo();
\ No newline at end of file
diff --git a/public/upload.php b/public/upload.php
new file mode 100644 (file)
index 0000000..003edf7
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+header('Content-Type: text/plain');
+header('Access-Control-Allow-Origin: http://yxnggys.cluster020.hosting.ovh.net');
+if (!isset($_POST['token']) || !$_POST['token']) {
+    exit;
+}
+
+$root=realpath(__DIR__ . '/../patients/');
+$dir = $root.'/' . $_POST['token'] . '/';
+// Create dir if not exits
+if (!file_exists($dir)) {
+    mkdir($dir, 0777, true);
+}
+
+
+// Copy all files received in the directory
+foreach ($_FILES['files']['name'] as $index => $name) {
+    if ($_FILES['files']['error'][$index]) {
+        continue;
+    }
+    move_uploaded_file($_FILES['files']['tmp_name'][$index], $dir . $name);
+}
\ No newline at end of file