How does thinkph determine whether an image is uploaded? -Php Tutorial

Source: Internet
Author: User
How does thinkph determine whether an image is uploaded? How does thinkph determine whether an image is uploaded?
The Avatar modification function allows you to upload images and use a new path for the image path. If no image is uploaded, the image path is still the original one.


Reply to discussion (solution)

The Avatar stores the path to the database. for example, DISCUZ stores the path under a rule to find whether the user's profile picture exists. if the profile picture is available, it defaults to the default one, and some call the directory; the general practice is to store the database. if it is null, the default setting is used. if there is one, you can directly call the path to display it.

1. check the $ _ FILES array.
2. if you call the upload method of the upload class, information will be returned.

Determine $ _ FILES.
Print it
Print_r ($ _ FILES );
You will know the difference between uploading and not uploading.

What is the relationship with thinkphp?
$ _ FILES is not enough?

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.