]> git.mxchange.org Git - simple-upload.git/blobdiff - README.md
Only add files if feature for listing them is enabled.
[simple-upload.git] / README.md
index 0937f48532f4e3a0186226ddec0a7effcf7553c4..4e87b68e331521671adda75896a64d2100c951c7 100644 (file)
--- 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,51 +21,45 @@ 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:
 
 
-- `uploaddir` => `'.'`
-       Directory to store uploaded files
-
-
-- `listfiles` => `true`
-       Display list uploaded files
+- Directory to store uploaded files
 
+       `uploaddir` => `'.'`
 
-- `listfiles_size` => `true`
-       Display file sizes
+- Display list uploaded files
 
+       `listfiles` => `true`
 
-- `listfiles_date` => `true`
-       Display file dates
+- Allow users to delete files that they have uploaded (will enable sessions)
 
+       `allow_deletion` => `true`
 
-- `listfiles_date_format` => `'F d Y H:i:s'`
-       Display file dates format
+- Display file sizes
 
+       `listfiles_size` => `true`
 
-- `random_name_len` => `10`
-       Randomize file names (number of 'false')
+- Display file dates
 
+       `listfiles_date` => `true`
 
-- `random_name_keep_type` => `true`
-       Keep filetype information (if random name is activated)
+- Display file dates format
 
+       `listfiles_date_format` => `'F d Y H:i:s'`
 
-- `random_name_alphabet` => `'qwertyuiodfgjkcvbnm'`
-       Random file name letters
+- Randomize file names (number of 'false')
 
+       `random_name_len` => `4`
 
-- `debug` => `false`
-       Display debugging information
+- Keep filetype information (if random name is activated)
 
+       `random_name_keep_type` => `true`
 
+- Random file name letters
 
-- `uploaddir => '.'`
-       Directory to store the uploaded files. Defaults to rurrect script directory
+       `random_name_alphabet` => `'qwertyuiopasdfghjklzxcvbnm'`
 
-- `listfiles => true`
-       Option that will list all files in uploads directory. Enabled by default
+- Display debugging information
 
-- `debug => false`
-       To display debugging information
+       `debug` => `($_SERVER['SERVER_NAME'] === 'localhost')`
 
 ## Usage options
 
@@ -70,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;
+               }
+       }