asp.net mvc - kendo upload allowmultiple autoupload calls the API multiple times -
i using kendo upload feature. while have set uploadmultiple option true , autoupload false.
if select 2 files , click on upload button, save api function called 2 times, once each file.
is possible call function once both attachments passed in parameter ?
<input name="attachments" type="file" id="attachments" /> <script type="text/javascript"> $(document).ready(function () { $("#attachments").kendoupload({ async: { saveurl: '@url.action("save", "appconfig")', autoupload: false, allowmultiple: true } }); }); </script> [httppost] public actionresult save(ienumerable<httppostedfilebase> attachments) { if (savefiles(attachments) { return content(""); } else { return content("error"); } }
by default selected files uploaded in separate requests.
if want download them once need set async.batch
option true
:
$("#attachments").kendoupload({ async: { saveurl: '@url.action("save", "appconfig")', autoupload: false, allowmultiple: true, batch: true } });
Comments
Post a Comment