Re: Warning: chmod(): Operation not permitted ?
| From: | Richard Lynch | Date: | Thu, 18 May 2006 23:46:28 +0000 |
| Subject: | Re: Warning: chmod(): Operation not permitted ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236458@lists.php.net to get a copy of this message | ||
On Wed, May 17, 2006 10:01 am, tedd wrote:
> I have a program that uploads an image file and then tries to set the
> permissions for the image (to be altered later). However, I get a
> "Warning: chmod(): Operation not permitted" error when trying to set
> the permission, what gives? If my program created the file, shouldn't
> it have permission to set the files permissions?
>
> What am I not understanding?
If you are trying to chmod() the file that is in /tmp from the $_FILES
array, you probably can't do that -- but after you
move_uploaded_file() you should be able to chmod that... Works for
me.
You may need to play with the directory to which the files are moving
and you may want to do:
$old = umask(0);
move_uploaded_file(...);
umask($old);
http://php.net/umask
Also research what current owner/group and permissions are on the file
to see how you got into this problem to start with.
--
Like Music?
http://l-i-e.com/artists.htm