Home > Article > Backend Development > javascript - About uploadify uploading all images at the same time
1. How does Uploadify bind the button button? Is it in
$(document).ready(function(){
<code>$("#button_id").uploadify();</code>
});
This doesn’t seem to work.
2. In addition to pictures, when I upload, there are many other values that need to be entered. I know that I can use the settings method to bind these values, but when I click to upload, when I select multiple pictures, there is only one. It has been uploaded, can multiple pictures be uploaded to the same controller at the same time? Because I found that when selecting automatic upload, this is uploaded to the background one by one. At this time, you need to write the image name to the database first, and then write the relevant data. But here my picture table and data table are separated, and there is a pic_id associated with them. How can I ensure that the pic_id of the picture is the same as the id of the data table? I'm more confused about this now? Thank you
1. How does uploadify bind the button button? Is it in
$(document).ready(function(){
<code>$("#button_id").uploadify();</code>
});
This doesn’t seem to work.
2. In addition to pictures, when I upload, there are many other values that need to be entered. I know that I can use the settings method to bind these values, but when I click to upload, when I select multiple pictures, there is only one. It has been uploaded, can multiple pictures be uploaded to the same controller at the same time? Because I found that when selecting automatic upload, this is uploaded to the background one by one. At this time, you need to write the image name to the database first, and then write the relevant data. But here my picture table and data table are separated, and there is a pic_id associated with them. How can I ensure that the pic_id of the picture is the same as the id of the data table? I'm more confused about this now? Thank you
Because it is not convenient to test the plug-in at the moment, but the idea is definitely the same. I will give you my idea for your reference.
Your design separates the resource table from the data table. The data table is associated with the resource ID. When submitting data to the data table, do you only need to get the resource ID? That is to say, upload the resource first through Ajax and return the resource ID, so that whether it is uploading one or multiple images, it can be processed equally.
① The plug-in uploads image resources and gets the resource ID
②Submit data