Monday, August 8, 2011

Deleting files in server without any error using php

To delete files in server and avoid "denied access to file" error to unlink file.

To delete file, you must to change file's owernship .

An example:

<?php
chown($TempDirectory."/".$FileName,666);
unlink($TempDirectory."/".$FileName);
?>