I've a picture uploader on my small site...

The look is submitted to some temporary 777 folder (this picture works fine and may be erased), Then i copy this file right into a new dir with copy() the brand new file is written to some 777 folder, but can't be erased. chmod() does not appear to assist...

How come the copy() function produce the new file in some way dissimilar to the initial file? I can not use whatever variations during my FTP client. Have perms 644 and user 'nobody/99' - but it is merely a problem for that second file.

Any ideas?

Because copy() constitutes a new COPY from the file. Only its contents will stay. Permissions from the new file are controlled because of your script's umask() setting, and also the new filename is controlled on your part.

You have to by hand set the permissions bits yourself: do this.

copy($temp_img_url, $save_file_as); chmod($save_file_as, fileperms($temp_img_url));

The problem was parents folder.

I desired to chmod() parents folder, despite the fact that i'd managed to get wit 777 perms....