Hard to say, I assume it's not working ? If the file is not deleted, check if $file contains a full path, or a relative one. The problem could be in deleteFile(), so show what it does.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
Remove the @ before unlink and see if it throws an error.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
Echo the parameter in unlink, and check whether it is a valid file.
pritaeas
Posting Expert
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875