aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2019-04-30 20:49:33 -0400
committerThedro Neely <thedroneely@gmail.com>2019-04-30 20:49:33 -0400
commit7267aff8c01d2fd9568de3a48f8fdf9840e9be5d (patch)
treed93d56aba5e199d02601f7686671864a69dd49a6 /app/controllers
parent58e193cd9c06122b30eadf568c920dd6f9df7f46 (diff)
downloadthedroneely.com-7267aff8c01d2fd9568de3a48f8fdf9840e9be5d.tar.gz
thedroneely.com-7267aff8c01d2fd9568de3a48f8fdf9840e9be5d.tar.bz2
thedroneely.com-7267aff8c01d2fd9568de3a48f8fdf9840e9be5d.zip
app/Routes: Add file upload page
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/upload.controller.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/upload.controller.php b/app/controllers/upload.controller.php
new file mode 100644
index 0000000..5a28370
--- /dev/null
+++ b/app/controllers/upload.controller.php
@@ -0,0 +1,18 @@
+<?php
+
+if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+
+ $uploadedFile = $_FILES['upload'] ?? null;
+
+ if ($uploadedFile) {
+ move_uploaded_file(
+ $uploadedFile['tmp_name'], 'uploads/'
+ . uniqid()
+ . '-'
+ . $uploadedFile['name']
+ );
+ }
+
+}
+
+require '../app/views/upload.view.php';