├── LICENSE ├── README.md ├── css.css └── index.php /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2013 Sala Kabir 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Installation # 2 | 1. Install a webserver 3 | 2. Install PHP 4 | 3. Create a new folder called "up" in the same directory of index.php 5 | 4. `chmod 755 up` 6 | 5. That's it 7 | 8 | # Configuration # 9 | * `$title`: Title of the page 10 | * `$filedir`: Directory where files will get uploaded 11 | * `$maxsize`: Maximus size (in bytes) of the uploaded file 12 | * `$allowedExts`: Allowed extensions 13 | * `$allowedMime`: Allowed mime types 14 | * `$baseurl`: Path of index.php 15 | 16 | # License # 17 | This code is released under the [WTFPL V2](http://www.wtfpl.net/ "WTFPL V2") license 18 | 19 | # Demo # 20 | A demo is avaiable [here](http://spittiepie.com/img/ "here") 21 | 22 | # Warranty # 23 | This project is released __without warranty__. 24 | I've coded this without prior knowledge of PHP in few hours, so it's probably full of bad habit. 25 | Don't complain with me if someone uses this to hack your server. 26 | You may want to disable PHP in the "up" folder, to increase security. 27 | Remember to set a size limit in your php.ini and/or your webserver too. 28 | -------------------------------------------------------------------------------- /css.css: -------------------------------------------------------------------------------- 1 | #upload { 2 | margin-left: auto; 3 | margin-right: auto; 4 | width: 50%; 5 | } 6 | #info { 7 | font-size: 75%; 8 | } 9 | #image { 10 | margin-left: auto; 11 | margin-right: auto; 12 | width: 50%; 13 | } 14 | #image input[type="text"] { 15 | width: 100%; 16 | } 17 | #image img { 18 | margin-left: auto; 19 | margin-right: auto; 20 | display: block; 21 | max-width: 100%; 22 | max-height: 80%; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | <?php print $title; ?> 13 | 14 | 15 | 16 |
17 |
18 | 19 | Choose a file to upload:
20 | 21 | 22 |
23 |
24 | Max file size: 5mb
25 | Supported formats: png, jpg, gif
26 | Please don't upload anything illegal 27 |
28 |
29 |
30 | 31 | '; 45 | print 'Your URL:
'; 46 | print '

'; 47 | print '

'; 48 | } 49 | 50 | else { 51 | print '
'; 52 | print 'Something went wrong
'; 53 | } 54 | 55 | } 56 | ?> 57 |
58 | 59 | 60 | 61 | --------------------------------------------------------------------------------