Lefora Free Forum
10 views

Create a Simple uploading script

Page 1
posts 1–1 of 1
novice - member
25 posts
You can use, abuse and mod this script all you want to create your file host script ^^ This script will allow immages smaller than 2MB to be uploaded. you can however easily change this simply by editing a few obvious variables! Quote:
" ."Select your file for upload:  " .""; } //This function will upload your file function upload(){ //Let's collect all info into variables $file = $_FILES['file']['name']; $type = $_FILES['file']['type']; $size = $_FILES['file']['size']; $temp = $_FILES["file"]["tmp_name"]; //Let's set max file size to 2mb $max_size = "2097152"; //Now set allowed file types $allow_type_1 = "image/jpeg"; $allow_type_2 = "image/gif"; $allow_type_3 = "image/png"; $allow_type_4 = "image/bmp"; //If file size is bigger than 2mb than let's display an error if($size > 2097152){ die("File is to big!"); }
Page 1
posts 1–1 of 1

This Topic Is Locked To Guest Posts

It's been a while since this topic was active, if you'd like to get it going again, please post as a registered member

join now