PHP unlink Remove _php tutorials on issues

Source: Internet
Author: User
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) ;

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.