我们正尝试使用kendo-dropzone功能来增强Web应用程序中的上载功能,在拖放文件的情况下,当拖放功能有效时,在浏览器上选择文档的正常流程效果很好到表单上的拖放区存储桶中,提交httprequest.files(0)没有文件属性和内容
想知道是否有人遇到过这种情况以及如何解决?
下面是代码段。
.aspx页面:
<form id="frmWordAutamation" name="frmWordAutamation" data-ajax="false"
method="post" runat="server" enctype="multipart/form-data">
<asp:Panel ID="KendoUpload" runat="server" >
<div id="KendoUploadDiv">
<div id="upload-dropzone">
<div class="dropzone">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="form-group mb-0">
<div class="mt20 upload-or-drag mt5">
<span class="vm micro">Drag and drop documents here or click browse to select file(s)</span>
<a href="#" onclick="OpenUploadDialogue()" class="btn btn-blue upload-button pull-right">Browse...</a>
</div>
<span id="fileSizeLimitExceedMessage" class="micro italic d-block mt5">
<p style="font-style: italic; margin-top: 0.5rem;" id="uploadLimitMessage" runat="server"></p>
</span>
</div>
<input name="fileUpld" id="fileUpld" type="file" runat="server"/>
</div>
</div>
</div>
</div>
</asp:Panel>
</form>
$(document).ready(function () {
$("#fileUpld").kendoUpload({
async: {
autoUpload: false,
removeUrl: "asyncRemoveUrl",
saveUrl: "asyncSaveUrl",
},
dropZone: ".dropzone",
multiple: false,
validation: {
maxFileSize: 20971520,
allowedExtensions: [".doc", ".docx"],
},
showFileList: true,
});
});
背后的代码:
strMimeType = Request.Files(0).ContentType
strNm = Request.Files(0).FileName
intIndex = strNm.LastIndexOf(".")
strFileNm = strNm.Substring(0, intIndex)
strFileExt = strNm.Substring(intIndex + 1)
strFileExt = LCase(strFileExt)
objDoc = New Document(Request.Files(0).InputStream)
该文件在javascript函数中的aspx文件中可通过拖放访问,但在提交表单时,它将作为request.files部分发送空白状态。