Hey all. I just noticed that when uploading image files from an HTML form with PHP that I've written, the file does indeed upload, but with permissions set at 600. Oddly enough, for these files, I cannot change permissions on them through my FTP program. I know that that's not really a PHP question, and it's not my real question, but does anyone know what's up with that? Weird.
Anyway, on to my actual question. I'm uploading these files on the PHP side with the standard move_uploaded_file() function, and they upload fine, but with what looks like a default set of permissions. Since it seems I can't set the proper permissions for these files through my FTP program, I figured I'd just do it through PHP after my file is successfully loaded. I'm using the following piece of code to do just this:
// $artwork is the name of the file with the appropriate directory information prepended already
if (!chmod($artwork, 0775))
{
// generate error message
}
After I run the script, I check the appropriate directory through my FTP program (Transmit, BTW, for the Mac and unregistered), the file is there, but the permissions still show as 600. I don't get any error message stating that the chmod() didn't work, so I don't have that to go on. Any idea why it wouldn't work? I know that according to the php.net documentation, chmod() doesn't work with remote files, but I thought that it would technically be considered a local file since the actual PHP script resides on the server. Is this why it won't work? If so, is there any possible workaround? Thanks.
James