Simple File Hosting Script

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:

<?php
$ext = end(explode(".",strtolower(basename($_FILES["file"]["name"]))));
$rand = rand(1000,9999);
$filename = strtolower(basename($_FILES["file"]["name"]));
$filename = md5($rand.$filename);
$md5_name = $filename. "." .$ext;
?>

The script also uses javascript to check for the Terms and Conditions checkbox being checked to make the submit button enabled.

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:

filehostingscript

Check out the demo here!

Click here to download the script!

This post was written by

Brian – who has written posts on bgallz.org.

Email  • Facebook  • Twitter

5

Filed Under: Scripts

Tags:

RSSComments (30)

Leave a Reply | Trackback URL

  1. Will Knot B. Revealed Snr. says:

    Excellent work man. How safe would you say this is to put on a production site?

    • Brian says:

      It is a pretty simple script, so I would recommend making some adjustments and upgrades for full-scale production but it is absolutely safe to use on your website.

      I would recommend installing a better human validation script such as CAPTCHA, etc.

  2. Andy says:

    The demo and download does not work.

  3. Most of the times i visit a blog i get disappointed.On the other hand,I could honestly say that you writting is decent and your website solid.

  4. Elana Oldani says:

    Hi! I found your blog on Bing.It’s really well written and it helped me a lot.

    Continue the good work!

  5. Mark Grandin says:

    Really nice article, I have been looking to read something of this nature and your writing has fit the bill perfectly, thanks very much indeed.

  6. Jason Thomas says:

    Hello ! Love your blog thanks for sharing it with me. Support local business.

  7. Thanks lots, I’ve found this article very nice!

  8. Thanks for have very wonderful informations. Your word wide web is greatI am impressed by the facts that you have on this weblog. It exhibits how properly you realize this subject. Bookmarked this excellent web page, will appear again for extra. You, my friend, amazing! I discovered just the facts I by now looked for all over the place and just wasn’t able to discover. What a ideal internet site. Such as this webpage your internet site is 1 of my new most-loved.I similar to this info shown and it has offered me some type of ideas to have success for some cause, so maintain up the fine function!

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.