Posted by: prajapatinilesh | August 8, 2007

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>

Advertisements

Responses

  1. Any Idea about setting up circular replication using
    My-Sql.

    If have any document then update me.

    Kalpak


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 )

Google+ photo

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

Connecting to %s

Categories

%d bloggers like this: