--- /dev/null
+<?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