X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=README.md;h=4e87b68e331521671adda75896a64d2100c951c7;hb=afca84b91a5a6ba613ea1ceea9e9da52e856fddc;hp=c0ad4449818d71cd6a3cc9ed0757289103e268d3;hpb=8169ffcd5ddc26732c114ea98836676cd67f8556;p=simple-upload.git diff --git a/README.md b/README.md index c0ad444..4e87b68 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,15 @@ Simple single-file PHP file upload (file share hosting) script. -> :warning: **Security warning**: There is no limit on file size or file type. Please make sure that file permissions are set right so nobody can execute uploaded executables. Or exscape your desired directory! +> :warning: **Security warning**: There is no limit on file size or file type. Please make sure that file permissions are set right so nobody can execute uploaded code. See [server configuration](#server-configuration) for examples. + +## TODO + +- [x] Delete files +- [x] Private files +- [x] Sort by age +- [x] Auto-remove old files +- [ ] AJAX Uploader ## Installation @@ -13,7 +21,6 @@ Just drop a PHP file in any directory. It will work straight away There are few options that you can change by editing the file itself: - - Directory to store uploaded files `uploaddir` => `'.'` @@ -65,5 +72,36 @@ There are few options that you can change by editing the file itself: This example will upload a file and copy URL to clipboard: ```bash - curl -F "file=@file.jpg" your-host/sharing/ | xclip -sel clip + curl -F "file[]=@file.jpg" strace.club | xclip -sel clip ``` + +## Server configuration + +Do not allow uploaded code execution! + +### NGINX configuration example + +Edit the NGINX configuration file (`/etc/nginx/sites-enabled/fileuploader`): + + server { + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; + + root /usr/share/nginx; + index index.php; + + server_name localhost; + + location / { + try_files $uri $uri/ =404; + } + + error_page 404 /index.php; + + location /index.php { + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_index index.php; + include fastcgi_params; + } + }