Tiny PHP Uploader
<?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>
No comments yet.
Leave a Reply
-
Recent
- Photolisting Logic In PHP
- IMP Javascripts Functions
- PHP And CURL
- Javascripts : get mouse position
- List Of good Site Name
- Multi Select Box to MySql DB Table
- php ini settings
- PHP – Make URLs clickable (And short down)
- List files in dir
- Tiny PHP Uploader
- Multi Select Box to MySql DB Table
- List files in dir
-
Links
-
Archives
- December 2007 (1)
- August 2007 (12)
-
Categories
-
RSS
Entries RSS
Comments RSS