asp.net core mvc ajaxform submit files

<form id="form1" method="post" enctype="multipart/form-data" asp-controller="HardDisks" asp-action="ImportExcel">
                                <div class="fileupload btn btn-purple waves-effect waves-light">
                                    <span><i class="ion-upload m-r-5"></i>Choose File...</span>
                                    <input class="upload" type="file" id="files" name="files" multiple />
                                </div>

                                <button class="btn btn-default waves-effect m-b-5" type="button" onclick="funSubmit()" style="margin-top:5px;">Submit</button>
                                <i class="md md-get-app" style="cursor:pointer" onclick="downdloadTemplate()"></i> 
                            </form>

function funSubmit() {
            $("#form1").ajaxSubmit({
                success: function (data) {
                    alert(data);
                }
            });
        }

  

posted @ 2017-12-06 09:18  Javi  阅读(411)  评论(0编辑  收藏  举报