I am trying to delete a file from a directory and getting errors
this is what I have
The name of the script file is
delete_record.php
The path of this file is c:\inetpub\wwwroot\dhl\current_development\upload\delete_record.php
What I want to do is remove a file that is located in c:\inetpub\wwwroot\dhl\current_development\upload\QS0109010135.jpg
This is the script delete_record.php
<?php
$h= opendir(".");
while($file= readdir($h)){
echo $file;
$file_2 = "QS0109010135.jpg";
unlink($file_2);
}
closedir($h);
?>
I recieve this error
.
Warning: Unlink failed (No such file or directory) in c:\inetpub\wwwroot\dhl\current_development\upload\delete_record.php on line 22
..
Warning: Unlink failed (No such file or directory) in c:\inetpub\wwwroot\dhl\current_development\upload\delete_record.php on line 22
delete_record.php
Warning: Unlink failed (No such file or directory) in c:\inetpub\wwwroot\dhl\current_development\upload\delete_record.php on line 22
KM0109011515.jpg
Warning: Unlink failed (No such file or directory) in c:\inetpub\wwwroot\dhl\current_development\upload\delete_record.php on line 22
What is the problem? I read the manual and can not figure it out
Thanks