Is it possible to reorder added files using Fine Uploader?

*爱你&永不变心* 提交于 2019-12-11 01:53:30

问题


I need to allow the user to select a number of images and then visually rearrange the order in which they are uploaded (ideally via a dragging interface) to my server. Does anyone know if this is possible with Fine Uploader?


回答1:


I think you are going to have to ask the user to number the images no matter what. There are several instances that could cause your approach to backfire. Even if reordering is allowed, there is no guarantee that images uploaded simultaneously are going to complete in the order they appear. So, you would have to restrict simultaneous uploads to 1. Even then, what if one upload fails due to a temporary network issue and then the Uploader moves on to the next file and it succeeds? The auto retry feature may make this less likely, but its still possible. In the end, you will end up jumping through a lot of hoops without any guarantee that the order will always respected.

There are two ways to handle your situation, as I see it. One way is to ask the user to number the images. You can then send these numbers as request parameters using fine Uploader and sort them out server side. Another option is to use a sorting javascript library to allow the user to rearrange the files visually. Just before the upload begins (after they have pressed a submit or done button) you can programmatically determine the order and send the index of each file as a request parameter, again using the setParams API method.



来源:https://stackoverflow.com/questions/16429377/is-it-possible-to-reorder-added-files-using-fine-uploader

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!