如何使用fineUploader一次获取所有发布的文件? [英] How to get all posted files at once using fineUploader?

查看:60
本文介绍了如何使用fineUploader一次获取所有发布的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个fineuploader,它允许在MVC Web应用程序中上传多个文件.

I have a fineuploader that allows multiple files to be uploaded in MVC web app.

示例: 假设我上传了3个文件,分别为5MB,20MB,1MB

Example: Suppose I upload 3 files 5MB, 20MB, 1MB

我希望3个文件可以在一次调用中到达控制器,但事实并非如此. 我想迭代所有3个文件(数组)并处理

I expect 3 files to arrive in the controller in single call but they are not. I want to iterate all 3 files (array) and process

问题1 :是否可以同时在服务器中获取所有3个文件?

Question 1: Is there a way to get all 3 files at once in the server?

[HttpPost]
public FineUploaderResult UploadFile(FineUpload upload)
{
   //upload contains only one file at a time
   //for second file it gets call again even though I submit only once
}

推荐答案

否. Fine Uploader在单独的请求中发送每个文件.当前无法配置.如果您需要将文件捆绑在一起,则可以通过 params选项,或 setParams API方法.在服务器端,您可以在每个上载POST请求中查找此公用参数,并相应地处理文件.

No. Fine Uploader sends each file in a separate request. This is not currently configurable. If you need to tie your files together, you can easily do that by passing common parameters with each file via the params option, or the setParams API method. Sever-side, you can look for this common parameter in each upload POST request and deal with the files accordingly.

这篇关于如何使用fineUploader一次获取所有发布的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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