James Keeline wrote: > --- Wade Smart <[EMAIL PROTECTED]> wrote: > >> On the system Im working with php is run under Apache which is www-data. So >> when I upload a pic www-data is the owner. >> >> But I found the problem. Well - not "the" problem but why its doing this. A >> note in the code says: >> >> // Note: cant get the picts to delete. Work on later. >> >> Ah! Who knows how old that is :) Just leave it for later. That was their >> answer. >> >> Some of the older pictures are permission 644 in them main picture file but >> they were not deleted either. Rest are 600. >> >> I doubt this script ever worked as this goes back at least four years and no >> pictures were deleted. >> >> So to get around this, can I write a script that does something with the file >> >> once it is uploaded? >> >> And Im reading posix now. >> >> Wade > > > The ability to delete a file is the same as writing to the file. The user > needs write permissions. You say that the files are owned by www-data and are > either 644 (-rw-r--r--) or 600 (-rw-------). If your webserver is running as > www-data now (sometimes there are changes with upgrades or server moves) then > you should be able to unlink() the file. You may not be able to manually > delete the file as another user. > > There could be some extra features in the OS configuration which might prevent > deletions from PHP but this is not a standard thing so it is unlikely. > > James
20080823 0607 GMT-6 Yesterday many teachers uploaded new pictures. Right now all the original picts are 600 and all the thumbs are 644. I know for sure one teacher deleted a file and it did not remove the original files. As a note - I did find this yesterday. One of the teachers only uploaded one picture. That one picture was permission 664. Im not sure why though. Their original server was windows but have since moved to some version of red hat. I think (if I push hard enough) they will be moving to a ubuntu server soon. I dont think RH has any extra feature like you were saying. Wade