From 94daf8ad98b19afbd4320078b9d1ee25c9fb82f1 Mon Sep 17 00:00:00 2001 From: c+1 Date: Sun, 1 Sep 2024 21:48:56 -0400 Subject: Initial commit. Allows for the uploading of files. --- public/.htaccess | 10 ++++++++++ public/admin.php | 0 public/index.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ public/view.php | 0 4 files changed, 57 insertions(+) create mode 100644 public/.htaccess create mode 100644 public/admin.php create mode 100644 public/index.php create mode 100644 public/view.php (limited to 'public') diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..e46b2d9 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,10 @@ +RewriteEngine On + +RewriteCond %{REQUEST_URI} ^/$ [OR] +RewriteCond %{REQUEST_URI} ^/index\.php$ +RewriteRule ^(.*)$ /index.php [L] + +RewriteCond %{QUERY_STRING} ^v=([a-zA-Z0-9\_\-\~\!\*]{8})$ +RewriteRule ^$ /view.php?v=%1 [L,QSA] + +RewriteRule ^admin\.php$ /admin.php [L] diff --git a/public/admin.php b/public/admin.php new file mode 100644 index 0000000..e69de29 diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..f656154 --- /dev/null +++ b/public/index.php @@ -0,0 +1,47 @@ + $UPLOAD_MAX_SZ]) { + echo "File too large."; + } else { + if (move_uploaded_file($f['tmp_name'], $targetf)) { + $cmd = escapeshellcmd( + "$FILE_PROCESSING_CMD " . + escapeshellarg($targetf) + ); + + shell_exec($cmd); + echo "Uploaded."; + } else { + echo "Error uploading."; + } + } +} + +?> + + + +
+ + +