Instant File Hosting with a Simple PHP script

Dmitri Popov

Productivity Sauce

Jan 14, 2013 GMT
Dmitri Popov

Not comfortable with hosting images and files using third-party services? If you already have a Linux server, then you can easily turn it into a no-frills file hosting solution using a PHP script from sebsauvage.net. Download the script and change the default password in it. Rename then the script to index.php, create a separate directory for it on your server (e.g., uploads), and upload the script into it. Use then the chown -R www-data uploads command to make the uploads writable by the server, and you are done.

Point your browser to http://127.0.0.1/uploads (replace 127.0.0.1 with the actual IP address or domain name of the server), and you should see a simple upload form. Use it to upload the files and images. By default, all uploaded files are stored in the separate files directory, and if you can't view its contents in the browser, you have to make it writable using the chmod -R 777 files command.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News