I have read a lot of pages about this but I just can't get it to work.
I have a file on my server that needs to be deleted after the file has been imported.
The file is a .csv file and opened with fopen
.
After import the file is closed with fclose
.
Now I want to delete the file with:
chown($filepath, 666);
if (file_exists($filepath))
{
if (unlink($filepath))
{
echo "success";
}
else
{
echo "fail";
}
}
else
{
echo "file does not exist";
}
It keeps failing with file does not exist
but I don't know why.
I use the exact same path to import
M.