问题
I have a fineuploader that allows multiple files to be uploaded in MVC web app.
Example: Suppose I upload 3 files 5MB, 20MB, 1MB
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
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
}
回答1:
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.
来源:https://stackoverflow.com/questions/21056720/how-to-get-all-posted-files-at-once-using-fineuploader