Page 1 of 1

Upload images to my server??

Posted: Sat Mar 27, 2004 5:19 am
by lazersam
Hi all

I am trying to write a real simle script that uploads a pic from the clients pc to my sevrer.

The form seems ok. The address to the pic is stored in $pic1.

The handler script looks like this...

Code: Select all

<?php
$root = $_SERVER['DOCUMENT_ROOT'];
		
		
		$pic1 = stripslashes($pic1);
		
		echo "pic1 = $pic1 <br>";
		echo "root = $root <br>";
		
		
		 copy ("$pic1", '$root/SuperAd/MembersArea/temp_pics/$t_pic1'   )
		 or die ("Could not copy file"  );
		 
				 
		 echo "pic1_name = $pic1_name <br>";
		 echo "pic1_size = $pic1_size <br>";
		 echo "pic1_type = $pic1_type <br>";
?>
I keep getting an error..
Warning: copy(C:\*****\calvin.gif): failed to open stream: No such file or directory in /*****/premium_handler.php on line 15
Could not copy file
Any ideas?

Thanks

Lawrence.

Posted: Sat Mar 27, 2004 5:54 am
by litebearer

Posted: Sat Mar 27, 2004 6:05 am
by lazersam
litebearer wrote:try this...

http://codewalkers.com/faq/2/28.html


Lite...
Thanks - thats very useful :)

Lawrence.