Usually, we upload pictures to upload single sheets. In FACT, IVX also provides the function of uploading pictures in batches. Today, we will talk about the specific operation of uploading pictures in batches.
You start with an array of objects to store the batch uploaded images, and then loop through the for container to create a list of images. Each image is followed by a bodeoff icon to remove the current data from the array of objects, but only from the foreground array of objects.
Then was part of the image upload, used here is the file interface component reads the actions of local image, we can get in the action of the callback parameter “read” results, it contains a list of images and read the failure reason of two parts, if read failure reason is empty it means read the success, the image list is in the form of an array of objects, The “list of uploaded images” and database fields are added based on it. We can print it out and look at it. Where path is the URL of the image and SRC is the base64 encoding of the image.
Finally, in the click event we assign the callback parameter of the file interface to “upload your picture list”, and then submit the “uploaded picture list” to the database.