fine-uploader

Is it possible to reorder added files using Fine Uploader?


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?


Solution

  • 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.