This project provides a secure, temporary file-upload service with time-limited access. It generates a unique URL for file uploads, includes CAPTCHA protection, and sends the URL to the user via email. The following is a list of key functionalities and features implemented in this project.
-
Secure URL Registration
- Generates a unique URL for each request.
- Protects URL generation with CAPTCHA to prevent abuse.
-
Time-Limited URL Access
- URL expires 48 hours after creation.
- URL is sent only to the provided email address.
- After the URL is activated, the expiration time reduces to 1 hour for security.
-
User File Upload
- Allows users to upload files up to 1GB.
- Displays upload progress, including elapsed and remaining time estimates.
-
File Storage on NextCloud
- Uploaded files are stored in a fixed folder within NextCloud storage.
- Original filenames are replaced with a new generated name for privacy.
-
Metadata Generation
- A
.txt
metadata file is created for each uploaded file. - The metadata file contains the original filename and the sender’s email address.
- A
--
Example for FreeBSD:
$ pkg install redis
$ service redis enable
$ php -v
PHP 8.3.9 (cli) (built: Sep 21 2024 02:23:37) (NTS)
$ pkg install php83-pecl-redis
service php-fpm restart
composer --version
composer install
composer show
composer require phpmailer/phpmailer
- Prepare config.php
$ cp config/.config.php.default config/.config.php
-
Edit config.php
Fill NextCloud data for connect
-
Configure NGINX.
Main page
upload.php
location ~ /\.(?!php).* {
deny all;
access_log off;
log_not_found off;
}
location ~ ^/upload/.*\.php$ {
root /usr/local/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /upload {
root /usr/local/www;
index upload.php;
try_files $uri $uri/ =404;
}
NextCloud: