Phpunlink deletion problems. Phpunlink deletion problems when deleting images, such as: unlink(abcdef.jpg); this can be deleted normally; however, when the file name is read from the database, fn $ rs [abc] cannot be deleted; unlink ($ fn ); php unlink deletion
When you delete an image
Example: unlink('abcdef.jpg ');
In this way, the deletion is normal;
But the file name cannot be deleted when it is read from the database.
Fn = $ rs ['ABC'];
Unlink ($ fn );
It cannot be deleted. Have you ever encountered such a situation.
Prompt message:
Warning: unlink (user_logo/javasd4d84f383714d5f3.jpg) [function. unlink]: No such file or directory in
------ Solution --------------------
Didn't he make it clear?
No such file or directory does not have such a file or directory
------ Solution --------------------
Error message file does not exist
The path is incorrect.
------ Solution --------------------
Check whether the file exists before deleting it.
Warning: the file or directory does not exist.
If (file_exists ($ fn )){
Unlink ($ fn );
}
------ Solution --------------------
Check your user_logo/directory to see if this file exists in this directory.
If no value exists, delete it and add a judgment.
If (file_exists ($ fn) {// This file exists
// Delete todo
}
Http://www.bkjia.com/PHPjc/820407.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/820407.htmlTechArticlephp unlink deletion issues such as: unlink('abcdef.jpg ') when deleting images; this can delete normal; but the file name cannot be deleted when reading from the database fn = $ rs ['ABC']; unlink ($ fn...