Alice, I see that you are using windows. For windows only the write permission for the folder and file isn't enough. You need to change the owner ship of the file as well so that u have privilege to delete. Do this , this might work: //Change the owner ship of the file to a non existent user in the system chown($directory."/".$file,666); unlink($directory."/".$file); Thanks, V