Javascript-about uploadify uploading all images at the same time

Source: Internet
Author: User
1. how does uploadify bind the button? is it in $ (document). ready (function () {code...}); this does not seem to work. 2. that is, there are many other values that need to be input in addition to the image to be uploaded. I know that these values can be bound using the settings method, but when I... 1. how does uploadify bind the button?

$ (Document). ready (function (){

$("#button_id").uploadify();

});
This does not seem to work.
2. there are many other values that need to be input in addition to images for uploading. I know that these values can be bound using the settings method. However, when I click upload, when multiple values are selected, can I upload only one file to the same controller at the same time? Because I found that when automatic upload is selected, the image name is uploaded to the database first, and then relevant data is written. However, here, the image table and data table are separated and there is a pic_id in the middle. how can we ensure that the pic_id of the image is the same as the data table id? Why am I confused? Thanks.

Reply content:

1. how does uploadify bind the button?

$ (Document). ready (function (){

$("#button_id").uploadify();

});
This does not seem to work.
2. there are many other values that need to be input in addition to images for uploading. I know that these values can be bound using the settings method. However, when I click upload, when multiple values are selected, can I upload only one file to the same controller at the same time? Because I found that when automatic upload is selected, the image name is uploaded to the database first, and then relevant data is written. However, here, the image table and data table are separated and there is a pic_id in the middle. how can we ensure that the pic_id of the image is the same as the data table id? Why am I confused? Thanks.

It is inconvenient to test the plug-in at the moment, but the idea must be the same. here is my idea for your reference.
Your design is to separate the resource table from the data table and associate the data table with the resource ID. do you only need to get the resource ID when submitting the data to the data table? That is to say, you can upload resources first through Ajax and return the resource ID. in this way, either one or multiple uploads can also be processed.

① The plug-in uploads image resources and obtains the resource ID.

② Submit data

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.