<?php

$pic = file_get_contents('http://mm214.com/images/art.gif');
//$_FILES
$fh = fopen('pic.txt',w);
fwrite($fh,$pic);
fclose($fh);
//print_r($_FILES);
foreach ($_FILES['fileupload'] as $key=>$value){
    echo $key.' '.$value.'<br>';
}
echo "Filename is :".$_FILES['fileupload']['name'];

move_uploaded_file($_FILES['fileupload']['tmp_name'],'lavarupload/'.$_FILES['fileupload']['name']);
?>

<form action="uploaddemo.php" method="post" enctype="multipart/form-data">
<input type="file" name="fileupload">
<input type="submit" name="submit" value="Upload">    

</form>      
