Tiny PHP Uploader





9
Date Submitted Thu. Feb. 22nd, 2007 5:20 PM
Revision 1 of 1
Beginner fleft
Tags File | Files | management | PHP | upload | uploader
Comments 4 comments
This is a Tiny PHP Uploading script. It SHOULD be safe from both really large files and non-image files.
<?if(isset($_FILES['x'])){if($_FILES['x']['size']>1024*1024){die('too big');}
if(substr($_FILES['x']['type'],0,5)=='image'){$p=$_FILES['x']['name'];copy($_FILES['x']['tmp_name'],$p);
echo $p;}else{die('not image');}}?><form action="" method="post" enctype="multipart/form-data">
<input type="file" name="x"><input type="submit"/><input type="hidden" name="MAX_FILE_SIZE" value="1048576"></form>

fleft fleft

Comments

Comments Afraid...
Thu. Feb. 22nd, 2007 6:13 PM    Helper Nico
Comments What's the point?
Sat. May. 12th, 2007 7:05 AM    Helper albud
Comments minimal
Fri. Feb. 23rd, 2007 9:48 AM    Beginner fleft
Comments Here
Fri. Feb. 23rd, 2007 10:11 AM    Beginner fleft

Voting