From 0311b21d23cc21d70d6a6091bf79b9b11eb5331d Mon Sep 17 00:00:00 2001 From: MrAkells Date: Fri, 2 May 2025 01:32:22 +0300 Subject: [PATCH] first commit --- README.md | 75 +++++++++++++++++++++++++++++++++++++++++ config.php | 4 +++ index.php | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ merge_chunks.php | 21 ++++++++++++ upload_chunk.php | 8 +++++ 5 files changed, 195 insertions(+) create mode 100644 README.md create mode 100644 config.php create mode 100644 index.php create mode 100644 merge_chunks.php create mode 100644 upload_chunk.php diff --git a/README.md b/README.md new file mode 100644 index 0000000..e16c0b0 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# Minimal Chunked File Storage (PHP) + +This is a minimalistic PHP-based file storage system with: + +* Password-protected admin panel +* Chunked file upload for large files (GB+) +* Upload progress display +* File listing with download and delete options +* Direct link copy button +* No external libraries required + +## 🚀 Features + +* Chunked upload via JavaScript + `fetch` +* Server-side chunk handling and merging +* No CSS or frontend frameworks +* Fully self-contained (no Composer needed) + +## 🛠 Requirements + +* PHP 7.4+ +* A web server (or use PHP's built-in server) + +## 📁 Folder Structure + +``` +/simple-file-share/ +├── index.php +├── upload/ # Final uploaded files +├── upload_chunks/ # Temporary chunk storage +├── upload_chunk.php +├── merge_chunks.php +└── config.php # Configuration (password and paths) +``` + +## 🔐 Configuration + +Create `config.php`: + +```php + +

Login

+ + + '; + exit; +} + +// Удаление +if (isset($_GET['delete'])) { + $f = basename($_GET['delete']); + @unlink(UPLOAD_DIR . $f); + header("Location: index.php"); + exit; +} + +$files = array_diff(scandir(UPLOAD_DIR), ['.', '..']); +?> + +Файловое хранилище + +

Файловое хранилище

+

Выйти

+ +
+ + + + + diff --git a/merge_chunks.php b/merge_chunks.php new file mode 100644 index 0000000..d57f5e4 --- /dev/null +++ b/merge_chunks.php @@ -0,0 +1,21 @@ +