commit 7a9e6fd1d6e8b2aa7085414cc2650e0c8f075e8c Author: MaciejkaG Date: Mon Jan 15 20:37:43 2024 +0100 Upload files to "public" diff --git a/public/create-folder.php b/public/create-folder.php new file mode 100644 index 0000000..0f15b26 --- /dev/null +++ b/public/create-folder.php @@ -0,0 +1,35 @@ +name; + $targetPath = $data->path; + + $fullTargetPath = join_paths($filesDir, $targetPath, $targetName); + + if (!file_exists($fullTargetPath)) { + if (mkdir($fullTargetPath)) { // Skopiuj zuploadowany plik do poprawnego miejsca na serwerze + http_response_code(200); + header('Location: '.$redirectRoute); // Przekieruj z powrotem do strony głównej + } else { // W razie gdyby coś nie wyszło po stronie serwera podczas kopiowania pliku + http_response_code(500); + echo "500 - Sorry, there was an error creating your folder."; + } + } else { + http_response_code(409); + echo "409 - File already exists"; + } +?> \ No newline at end of file diff --git a/public/file.php b/public/file.php new file mode 100644 index 0000000..2f92783 --- /dev/null +++ b/public/file.php @@ -0,0 +1,29 @@ +404 - Not Found (Requested file not found)"; } +?> diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..f2ce6ea --- /dev/null +++ b/public/index.php @@ -0,0 +1,186 @@ +getSize(); + } + } + return $bytestotal; + } +?> + + + + + + + Upload service + + + + + + + + +
+
+

Udostępnij plik

+ +

Zajęte miejsce: (%)

+

+

Wróć | Utwórz folder

+

+

"; // Pętla wyświetlająca każdy element z $dirList w formie linku + } else { + // Plik + echo ""; // Pętla wyświetlająca każdy element z $dirList w formie linku + } + } + } + ?> +
+

+
+ + + + + \ No newline at end of file diff --git a/public/style.css b/public/style.css new file mode 100644 index 0000000..66c61a8 --- /dev/null +++ b/public/style.css @@ -0,0 +1,85 @@ +body { + font-family: 'Quicksand', sans-serif; + background: rgb(242, 242, 242); +} + +.pobieranie { + padding: 40px; + font-family: 'Quicksand', sans-serif; +} + +.box { + display: flex; + justify-content: center; + font-family: 'Quicksand', sans-serif; +} + +.pliki { + line-height: 25px; + width: 500px; + max-width: 100vw; + display: flex; + flex-direction: column; + justify-content: center; + transition: opacity 0.3s; +} + +input { + font-family: 'Quicksand', sans-serif; +} + +.pliki a { + color: black; +} + +.pliki .plik { + display: flex; + margin-bottom: 10px; +} + +.plik .name, .plik .delete { + padding: 7px 12px; + display: flex; + justify-content: center; + align-items: center; + transition: all 0.2s; +} + +.pliki .plik .name { + background: white; + display: flex; + align-items: center; + justify-content: flex-start; + gap: 5px; + flex: 1; + border-top-left-radius: 20px; + border-bottom-left-radius: 20px; + border-right: rgb(208, 208, 208) solid 1px; + text-decoration: none; +} + +.pliki .plik .name:hover { + background: rgb(72, 91, 255); + color: white; +} + +.pliki .plik .delete { + background: white; + color: red; + border-top-right-radius: 20px; + border-bottom-right-radius: 20px; + text-decoration: none; +} + +.pliki .plik .delete:hover { + background: red; + color: white; +} + +.path { + border-radius: 10px; + font-family: 'Fira Code', monospace; + padding: 3px 5px; + font-size: 17px; + border: black 1px solid; +} \ No newline at end of file diff --git a/public/upload.php b/public/upload.php new file mode 100644 index 0000000..4876e7d --- /dev/null +++ b/public/upload.php @@ -0,0 +1,30 @@ + \ No newline at end of file