Doesn't ftp_chmod() work immediately after creating your file, while the resource is still open?

Check the permissions for the directory.

Check the file and dir permissions with your ftp utility [e.g., WinSCP]. Or, write a simple script that echoes them.

It really should work, I do it frequently.

tedd wrote:
Hi Gang:

I'm sure this is obvious to most, but not to me.

I working on a virtual host.

If I want to save data in a file, I can ftpconnect(); change the permissions of an existing file from 0755 to 0777; write to the file; and change the permissions of the file back to 0755 -- no problem.

However, if a file is not there, then I can create one. However, the permissions of the file will be automagically set to 0600 and as such, I can't change them via ftpconnect(). In other words, I can't FTP in to my site and change the permissions of a file I created. I can delete the file, but that's all.

How do you guys create a file and set its permissions working on a virtual host via php?

Cheers,

tedd

PS: If I remember correctly, it was pretty easy in perl. Just try to open/write a file and if it wasn't there, it created one for you. But, it's been years since I did any perl stuff -- could be wrong.


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

Reply via email to