I’ve made an easy to use file hosting script that is free for download.
It has some nice features such as:
- Allowed file extensions.
- File size limit.
- Generated file names.
- BBcode, IMG code, Url, etc.
- Terms of Conditions
Generated file names on the server are created using the functions rand() and the md5() hash generator. Here is the code:
$ext = end(explode(".",strtolower(basename($_FILES["file"]["name"])))); $rand = rand(1000,9999); // A random number for unique file names $filename = strtolower(basename($_FILES["file"]["name"])); $filename = md5($rand.$filename); $md5_name = $filename . "." . $ext; // Combine the new generated file name with the extension
I will be updating this script with more features, but this is meant to be a simple file hosting script. I will later include a download file page.
Here is what the upload form looks like: