0

我正在使用带有淘汰赛的剑道上传功能。控制器操作结果中的 HttpPostedFileBase 在 IE11、Chrome、Firefox 中始终显示为 null。但在使用 IE8、IE9 时效果很好。如果有人能解决这个问题,那就太好了。

查看.cshtml

        <form method="post" enctype="multipart/form-data" data-bind="kendoUpload: { async: { saveUrl: 'UploadController/Upload', autoUpload: false }, upload: OnUpload, success: OnSuccess, error: OnError, select: OnSelect, multiple: false }">
                                <input name="fileUpload" type="file" id="fileUpload" />
        </form>

控制器.cs

public virtual ActionResult Upload(HttpPostedFileBase fileUpload) { //Perform some action }
4

1 回答 1

1

尝试从.<input type=file>而不是<form>.

<form method="post" enctype="multipart/form-data" >
  <input name="fileUpload" type="file" id="fileUpload" 
        data-bind="kendoUpload: { async: { saveUrl: 'UploadController/Upload', autoUpload: false }, upload: OnUpload, success: OnSuccess, error: OnError, select: OnSelect, multiple: false }" />
</form>
于 2015-02-26T15:41:47.050 回答