From 20a7eeb659f10c2e93111dce05cc19125225865f Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 31 Jan 2025 11:23:17 +0100 Subject: [PATCH] Perform the upload of the file --- unsafe_gallery/src/.gitignore | 1 + unsafe_gallery/src/.htaccess | 1 + unsafe_gallery/src/index.php | 108 ++++++++++++++++++++++++---------- unsafe_gallery/src/style.css | 2 +- 4 files changed, 81 insertions(+), 31 deletions(-) create mode 100644 unsafe_gallery/src/.gitignore create mode 100644 unsafe_gallery/src/.htaccess diff --git a/unsafe_gallery/src/.gitignore b/unsafe_gallery/src/.gitignore new file mode 100644 index 0000000..95a48fb --- /dev/null +++ b/unsafe_gallery/src/.gitignore @@ -0,0 +1 @@ +uploads \ No newline at end of file diff --git a/unsafe_gallery/src/.htaccess b/unsafe_gallery/src/.htaccess new file mode 100644 index 0000000..45552cb --- /dev/null +++ b/unsafe_gallery/src/.htaccess @@ -0,0 +1 @@ +Options -Indexes \ No newline at end of file diff --git a/unsafe_gallery/src/index.php b/unsafe_gallery/src/index.php index 1752550..3eb3e71 100644 --- a/unsafe_gallery/src/index.php +++ b/unsafe_gallery/src/index.php @@ -1,43 +1,91 @@ 10000) { + $error = "File is too large!"; + } else if (move_uploaded_file($_FILES["file"]["tmp_name"], UPLOAD_DIR . "/" . $dest_file_name)) { + $success = "The file was successfully uploaded!"; + } else { + $error = "Error while uploading file!"; + } } ?> - - - - Safe gallery + - - - - -
- + + + Safe gallery -
-Note : Une information se cache dans la variable d'environnement FLAG. -
+ + + -

Upload file

+ +
-
-
- - -
-
- -
-
- -
+

Gallery manager

+ +
+ Note : Une information se cache dans la variable d'environnement FLAG. +
+ + +
+ +
+
+ +
+ +

Upload file

+ +
+
+ + +
+
+ +
+
+ +

Your files

+ +
- + + \ No newline at end of file diff --git a/unsafe_gallery/src/style.css b/unsafe_gallery/src/style.css index 4f41422..e89f41d 100644 --- a/unsafe_gallery/src/style.css +++ b/unsafe_gallery/src/style.css @@ -4,7 +4,7 @@ body { } .form-signin { - max-width: 530px; + max-width: 800px; padding: 1rem; }