Re: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file
I had the same problem... chmod doesn't work in Windows... I'm using win2000 server... to make uploads possible you have to set permissions to the users: IUSR_COMPUTERNAME and IWAM_COMPUTERNAME, set them both to FULL and test... At 15:54 1/10/2001 -0500, Joseph Koenig wrote: >The script is moving the file to its final destination and then doing a >chmod(filename, 0777) (the php function, not through exec() or >anything); Even setting the mode to 0777 doesn't help at all. Am I doing >this completely wrong from IIS/NT? Thanks, > >joe > >Joe Kaiping wrote: > > > > Sounds like their upload script isn't setting the correct file permissions > > when creating the file. Directory permissions don't seem to be a problem > > for you. > > > > -Joe2 > > > > > -Original Message- > > > From: Joseph Koenig [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, October 01, 2001 12:38 PM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file > > > > > > > > > I've got a script on an NT (IIS 4.0) server that uploads a file. When > > > the user attempts to replace the uploaded file with a new one via the > > > form, the script is generating errors. > > > > > > Warning: Unable to create > > > 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif': > > > Permission denied in > > > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > > > line 41 > > > > > > Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to > > > 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in > > > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > > > line 41 > > > > > > Is there anything I should have their IT guy check as to why > > > this script > > > can upload, but not replace a file? Thanks, > > > > > > Joe > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] _ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file
Hi Joe, I'm not familiar with PHP on Windows myself, but I just checked out the manual pages to see if it said anything and it sounds like chmod() doesn't work on windows: http://www.php.net/manual/en/function.chmod.php "Note: This function does not work on Windows systems" ditto for chgrp and chown. I also did a search on http://www.phpbuilder.com for you and it seems other people have had the same problem uploading files with Apache and IIS, but I didn't see a solution. When you update the file, have you tried to first remove the old version of the file and then write it? Sorry that I can't be more help. Maybe someone on the list that uses PHP on Windows knows a better solution? Best of luck! -Joe > -Original Message- > From: Joseph Koenig [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 01, 2001 1:54 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace > uploaded file > > > The script is moving the file to its final destination and > then doing a > chmod(filename, 0777) (the php function, not through exec() or > anything); Even setting the mode to 0777 doesn't help at all. > Am I doing > this completely wrong from IIS/NT? Thanks, > > joe > > Joe Kaiping wrote: > > > > Sounds like their upload script isn't setting the correct > file permissions > > when creating the file. Directory permissions don't seem > to be a problem > > for you. > > > > -Joe2 > > > > > -Original Message- > > > From: Joseph Koenig [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, October 01, 2001 12:38 PM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace > uploaded file > > > > > > > > > I've got a script on an NT (IIS 4.0) server that uploads > a file. When > > > the user attempts to replace the uploaded file with a new > one via the > > > form, the script is generating errors. > > > > > > Warning: Unable to create > > > 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif': > > > Permission denied in > > > > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > > > line 41 > > > > > > Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to > > > > 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in > > > > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > > > line 41 > > > > > > Is there anything I should have their IT guy check as to why > > > this script > > > can upload, but not replace a file? Thanks, > > > > > > Joe > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file
The script is moving the file to its final destination and then doing a chmod(filename, 0777) (the php function, not through exec() or anything); Even setting the mode to 0777 doesn't help at all. Am I doing this completely wrong from IIS/NT? Thanks, joe Joe Kaiping wrote: > > Sounds like their upload script isn't setting the correct file permissions > when creating the file. Directory permissions don't seem to be a problem > for you. > > -Joe2 > > > -Original Message- > > From: Joseph Koenig [mailto:[EMAIL PROTECTED]] > > Sent: Monday, October 01, 2001 12:38 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file > > > > > > I've got a script on an NT (IIS 4.0) server that uploads a file. When > > the user attempts to replace the uploaded file with a new one via the > > form, the script is generating errors. > > > > Warning: Unable to create > > 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif': > > Permission denied in > > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > > line 41 > > > > Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to > > 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in > > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > > line 41 > > > > Is there anything I should have their IT guy check as to why > > this script > > can upload, but not replace a file? Thanks, > > > > Joe > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file
Sounds like their upload script isn't setting the correct file permissions when creating the file. Directory permissions don't seem to be a problem for you. -Joe2 > -Original Message- > From: Joseph Koenig [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 01, 2001 12:38 PM > To: [EMAIL PROTECTED] > Subject: [PHP] PHP 4.0.6 on NT (IIS 4.0) Can't replace uploaded file > > > I've got a script on an NT (IIS 4.0) server that uploads a file. When > the user attempts to replace the uploaded file with a new one via the > form, the script is generating errors. > > Warning: Unable to create > 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif': > Permission denied in > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > line 41 > > Warning: Unable to move 'C:/PHP/uploadtemp\php4F6.tmp' to > 'D:/public/HJ/www.h-jenterprises.com/test/pics/catalog/104_2.gif' in > D:\public\HJ\www.h-jenterprises.com\test\admin\item_functions.php on > line 41 > > Is there anything I should have their IT guy check as to why > this script > can upload, but not replace a file? Thanks, > > Joe > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]