PHP - unlink() is not working

KevinUK

Can't get enough of FH
Joined
Dec 22, 2003
Messages
649
Code:
if (file_exists("/www/uploads/" . $row_files['file']))
  {
      unlink("/www/uploads/" . $row_files['file']) or die("cannot delete");
  }

I have posted this on some PHP boards but nobody answered :(

Basically this code always outputs cannot delete. I own the server, its windows 2003 and just as a test gave the directory and file full permissions so it cant be a permissions problem.

I also checked that the file does exist and is in that directory :p

I can upload files, read the contents of the zip through code just not delete / copy / move files so I dont know what the problem is.

Any ideas? Since it is getting into the file exists part I dont understand why it wont delete it.

Thanks :fluffle:
 

TdC

Trem's hunky sex love muffin
Joined
Dec 20, 2003
Messages
30,804
hmm, just a thought (I'm pish at PHP though it seems relativly easy tbh), but even though you said you gave full permissions to the file webservers often run as a very low permissions type user. as it's the webserver that runs PHP perhaps you should look there matey. can it be that windows doesn't allow the webserver to delete files on general security principals?
 

Users who are viewing this thread

Top Bottom