How to store the image address for multiimage uploads

Source: Internet
Author: User
Multi-image upload image address storage problem multi-image Upload

Upload multiple images. click next to add an image. the number of images cannot be limited,
I have never figured out how to store the image address. because there is no limit on the number of images in one piece of data, I cannot create 10000000 fields in advance?
There is another one that I think of but won't do. it is to traverse the uploaded folder. remember the name of the newly created folder during the upload. this won't happen.
How do you do this!


Reply to discussion (solution)

Table PHOTOS
PID Image ID auto-increment
TID Post ID
PHOTONAME image file name

Select * from PHOTOS where TID = $ tid

What does your answer mean. Can you take a closer look at the problem?

$ A = glob ('upload folder /*');
$ Fn = end ($ a); // name of the last uploaded File

Xuzuning is a bit deep. can you explain it again?
Which method is better to store images, directly store directories or store MYSQL images?

1. field normalization storage example/images/1.jpg::::/images/2.jpg or directly json_encode
2. storage folder

Separate multiple image addresses with commas?

One field stores the image information. you can put the path of multiple images in json.
Traverse the file and check the corresponding php function.

Separate multiple image addresses with commas? To prevent users from uploading files with commas. You can rename the uploaded file.

We recommend that you record an image with a url address.

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.