Why does YUI Uploader return all files in the queue after selecting a file?

Not sure if you are familiar with YUI Uploader, but after you click "browse" and select a bunch of files, the event callback returns a list of all the files in the queue, not just the ones you just finished. This creates some problem, because now instead of just adding the selected files to the user interface, you need to clear the list and add them all again. You cannot even calculate the difference between existing files and all files, because their file identifier also randomly changes, like the order of the files in the queue. This slows down the user interface because it has to re-add things that were already there and confuses the user as all of their materials are randomly ordered. How did people deal with this? It would be logical to sort files by file name,to maintain some consistency (although adding to the end would be more logical), or did someone develop some kind of complicated solution to figure out which files were actually selected in the last operation?

+3
source share
3 answers

in the current version of the YUI files added to event.fileList, to the end of the list with progressive identifiers and without shuffling their order. take a look at their example of downloading multiple files. It even continues the numbering order if you delete some files from the beginning of the queue.

+1
source

yahoo uploader, , , , , , , javascript div, span , , , , , , event.fileList.fileNUBER , onselect .

0

YUI "Uploader.clearFileList" "Uploader.removeFile". .

0

Source: https://habr.com/ru/post/1710129/


All Articles