PHP Unlink Removal issues
When you delete a picture
For example: Unlink (' abcdef.jpg ');
This can be removed normally;
However, the file name cannot be deleted when it is read from the database
fn= $rs [' abc '];
Unlink ($FN);
Can not be deleted, the master has encountered such a situation.
Tip Information:
Warning:unlink (user_logo/d4d84f383714d5f3.jpg) [Function.unlink]: No such file or directory in
------Solution--------------------
Didn't he say it clearly?
No such file or directory does not have such files or directories
------Solution--------------------
Error message file does not exist
It should be the wrong path.
------Solution--------------------
First determine if the file exists and then delete it.
The warning indicates that the file or directory does not exist.
if (file_exists ($FN)) {
Unlink ($FN);
}
------Solution--------------------
Look at your user_logo/directory to see if this file exists in this directory.
No, no, no, delete, add a judgment.
if (file_exists ($FN)) {//existence of the file
Todo Delete
}
http://www.bkjia.com/PHPjc/820407.html www.bkjia.com true http://www.bkjia.com/PHPjc/820407.html techarticle php Unlink Remove the problem when deleting the picture for example: Unlink (' abcdef.jpg '), this can be removed normally, but the file name cannot be deleted from the database fn= $rs [' abc ']; unlink ($FN) ;