Try following. Put this in image.htm:
<html>
<head>
<title> New Document </title>
</head>
<body>
<form method=post action="http://localhost/ee/image_upload.php">
<input type="text" name="image_name">
<input type="submit">
</form>
</body>
</html>
And this is image_upload.php:
<?php
$imagename = $_POST['image_name'];
if(empty($imagename))
{
print "You must specify image name.";
exit;
}
$fp = @fopen($imagename,'r') or die("Can not open image : $imagename");
$localimage = basename($imagename);//local image will have same name as image being uploaded.
$fp_new = fopen($localimage,'w');
if($fp)
{
while(!feof($fp))
{
$contents = fread($fp,4096);
fwrite($fp_new,$contents);
}
fclose($fp);
fclose($fp_new);
}
print "Image uploaded successfully.";
?>