--- 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