[HttpPost]
public ActionResult Index(IList<HttpPostedFileBase> UploadFiles)
{
return View();
} |
Thank you for your reply. We are having the issue where only the last file is returned when selecting multiple files with the ejs-loader control. This thread referenced a fix by Syncfusion that talked about performing a "Clear All" instead of a remove? I was seeking clarification on what if any resolution for this problem of passing only the last file back. Is there any way of preventing the ejs-control browse button from being clicked more than once? I know that your control captures multiple "files" from browse on the inital form instance and works properly in sending all files when you only browse 1x to select the files.
<div style="margin-top:20px;margin-left:20px;">
@Html.EJS().Uploader("UploadFiles").DropArea(".control-fluid").Multiple(false).AutoUpload(false).Selected("onSelect").Clearing("onClearing").Removing("onRemoving").Render()
</div>
<script>
function onSelect(args) {
disableBrowse(args);
}
function onClearing(args) {
disableBrowse(args);
}
function onRemoving(args) {
disableBrowse(args);
}
function disableBrowse(args) {
var uploadObj = document.getElementById("UploadFiles").ej2_instances[0];
var filesData = uploadObj.getFilesData();
var allFiles = filesData.concat(args.filesData);
var browseButton = uploadObj.browseButton;
browseButton.disabled = allFiles.length == 1 ? true : false;
}
</script>
|