Home >Backend Development >PHP Tutorial >javascript - About multiple image uploads

javascript - About multiple image uploads

WBOY
WBOYOriginal
2016-07-06 13:53:03970browse

For example, if you publish a product and have multiple corresponding pictures at the same time, there are two methods, which one is better, or how everyone does it:

  1. Upload the image first, get the image address, and then upload the image address when publishing the product

  2. First generate the product and return the corresponding id of the product, then upload the product id while uploading the image for binding

Reply content:

For example, if you publish a product and have multiple corresponding pictures at the same time, there are two methods, which one is better, or how everyone does it:

  1. Upload the image first, get the image address, and then upload the image address when publishing the product

  2. First generate the product and return the corresponding id of the product, then upload the product id while uploading the image for binding

Wouldn’t it be better to package and upload the images first, and then select the gallery when publishing the product? This is generally handled in the background. When publishing products, uploading images is cumbersome and error-prone, and many form items need to be backfilled

Personal opinion:
The second is better. The picture is attached to the product, not the other way around

The second option is to select directly from the photo library

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn