Patelkiranat1983′s Weblog

Just another WordPress.com weblog

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>


August 9, 2007 - Posted by | Uncategorized

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.