thinkph How to tell if there is a picture upload?

Source: Internet
Author: User
thinkph How to tell if there is a picture upload?
Do change the Avatar function, there is image upload, picture path with the new path. No image upload, the picture path is still the original


Reply to discussion (solution)

Avatar are to write the path to the database, like Discuz is stored in a certain rules of the path, to find whether there is a user's avatar, Wood has the default, some call directory under; The general practice is to store the database, for the empty default, and some words directly call the path to display it.

1, can judge $_files array
2, call the upload method of the upload class, there will be returned information

Judge $_files.
You print it.
Print_r ($_files);
I know there is the difference between upload and no upload.

What's the relationship with thinkphp?
Direct $_files not right?

  • 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.