如何在Ajax中使用Fine Uploader js框架 [英] How to use Fine Uploader js framework with ajax

查看:67
本文介绍了如何在Ajax中使用Fine Uploader js框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用fineuploader JS库来上传多个文件. 现在,按照我的要求,用户可以选择多个文件,然后这些选定的文件不应立即上载,而应该由该用户在上方进行查看和修改.确认用户后,我想获取所有文件列表,然后需要通过ajax JS函数逐一处理这些文件,以将转换为base64二进制数据的文件发送到我的服务器方法.

I want to use fineuploader JS library to use with upload multiple files. Now as per my requirement, user can select multiple files then those selected files should not be uploaded immediately instead of that user should above to review and modify them. once user is confirmed I want to get all the files list and then I need to process those files one by one by ajax JS function to send the files converted into base64 binary data to my server method.

我看过fileuploader文档,我知道我的前两个需求可以很容易地满足,用户可以选择多个文件并在升级到服务器之前对其进行修改,但是不确定如何对上载的文件使用ajax JS函数.我遇到了一个叫做uploadStoredFiles()的选项,但是同样会按照默认行为上传文件,如何获取所有文件数组,然后按照自己的方式处理它们.

I have seen fileuploader documents and I know my first two needs can be easily satisfied where user can select multiple files and modify them before uplaod to server, but am not sure how to use ajax JS function with uploaded files. I came across one option called uploadStoredFiles(), but again this will upload the files as per its default bahaviour, how can I get all files array and then process them as per my way.

推荐答案

您可以使用

You can get a list of all submitted files using the getUploads() API method, and you can get the underlying Blob/File object for each submitted entry using the getFile() API method.

但是请记住,状态是不会改变的,如果您自己上传文件,就上载者而言,其他任何事情也不会改变.您将拥有一个UI,其中填充了永不更改的已提交文件.请注意,在用户界面中反映这些文件状态的唯一方法是让上载程序很好地上传它们.

But keep in mind the status won't change, nor will anything else as far as fine uploader is concerned if you upload the files yourself. You'll have a UI filled with submitted files that never changes. Note that the only way to reflect the status of these files in the UI is to have fine uploader upload them.

这篇关于如何在Ajax中使用Fine Uploader js框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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