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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to