Page 1 of 1

I am trying to save an uploaded image into a dir I create.

Posted: Mon Sep 13, 2004 4:57 pm
by Phrank
feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


I have uploaded an image. Works great. It is in the temp dir the web hosting service created. I can also get an image into my mach running xp and IIS and PhP. The image is there in the temp php dir on my mach. 

I want to copy this image to a dir I create. I call that dir MyImage on both my mach and the web hosting service. I cannot get the image moved from the temp dir to my dir. 

Here is the code:

Code: Select all

if (!move_uploaded_file($TempPath,$OrgFileName )) 
{ 
echo "File could not be moved."; 
echo "<br>"; 
} 
else 
{ 
echo "We were able to move the uploaded file to the tempfilename."; 
echo "<br>"; 
}
I changed the permissions on my pc to full/everyting. Still no luck. I called the web hosting company the said to do the same with the dir I created on there server using FTP and Right Click Properties.

Still no luck.

Here is the output:

Code: Select all

TempPath=C:\PHP\uploadtemp\php14.tmp 
OrgFileName=c:\Inetpub\wwwroot\Kinders\MyImages\MV
C-013S.JPG 
Warning: move_uploaded_file(c:\Inetpub\wwwroot\Kinder\MyIma
ges\MVC-013S.JPG): failed to open stream: Permission denied in c:\inetpub\wwwroot\kinder\ImageValidationUtility.php on line 80
I am not sure what is going on or how to debug this. All permissions are granted to the dir I am trying to move the image file to. I can copy the file on my machine using Windows Explorer to the dir I created thus Php is having a problem. How do I go about finding it?

TIA

Frank
8O


feyd | Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Mon Sep 13, 2004 5:09 pm
by feyd
IIS runs under a different user than yours, make sure that user has write access to that folder.