是否可以使用Fine Uploader重新排序添加的文件? [英] Is it possible to reorder added files using Fine Uploader?

查看:70
本文介绍了是否可以使用Fine Uploader重新排序添加的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要允许用户选择一些图像,然后在视觉上重新排列它们(最好是通过拖动界面)上传到我的服务器的顺序.有人知道使用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?

推荐答案

我认为您无论如何都必须要求用户给图像编号.有几种情况可能导致您的做法适得其反.即使允许重新排序,也不能保证同时上传的图像将按照它们出现的顺序完成.因此,您必须将同时上载限制为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.

据我所知,有两种方法可以处理您的情况.一种方法是要求用户给图像编号.然后,您可以使用精细的Uploader将这些数字作为请求参数发送,并在服务器端进行分类.另一个选择是使用排序javascript库,以允许用户视觉上重新排列文件.在上传开始之前(按下提交或完成按钮之后),您可以以编程方式确定顺序,并再次使用setParams API方法将每个文件的索引作为请求参数发送.

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.

这篇关于是否可以使用Fine Uploader重新排序添加的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆