Page 1 of 1

file upload permission error on win box

Posted: Thu Jul 24, 2003 1:22 pm
by rxsid
Hi all,

Using a winNT4 box (can't upgrade/change at this point), with php 4.3.1 installed in the C:\php dir.

Trying to get copy() to work with a file upload.
Getting :

C:\thePath\tempFileUploads\php132.tmp

Warning: copy(attachements/2003) [function.copy]: failed to create stream: Permission denied in C:\path\dir\submitEntry.php on line 9

line 9 is

Code: Select all

$dirPath = "attachements/2003";
copy($entryAttachment, $dirPath);
I altered the php.ini file to indicate the above file path instead of the defaul.
The folder has the typical IUSR_machineid guest internet user permissions. I did assign write permissions via the MMC (microsoft management console) and by right clicking the folder and setting security. The folder deffinately has read/write permissions for the guest internet user.

I thought perhaps the php.exe needed write permissions (instead of just the default read), so I changed it to include write as well.

So...the temp folder and the php.exe have write permissions & the actual script has read/write.

why can't i write to the temp dir? what am i missing as far as permissions...any ideas??

thanks!

Posted: Fri Jul 25, 2003 1:04 am
by Tubbietoeter
I believe that you must specify the file name for the source and the target.

try this:

$destFile = "attachements/2003/dest.file";
copy($entryAttachment, $destFile);


also, try to specify the whole path

$destFile = "c:/blabla/attachements/2003/dest.file";
copy($entryAttachment, $destFile);