我有一个在 Jquery 中创建的剑道上传器
HTML:
<div id="example" class="k-content">
<input type="file" name="files" id="files" />
</div>
查询:
<script id="fileTemplate" type="text/x-kendo-template">
<span class='k-progress'></span>
<div class='file-wrapper'>
<h4 class='file-heading file-name-heading'>Name: #=name#</h4>
<h4 class='file-heading file-size-heading'>Size: #=size# bytes</h4>
<button type='button' class='k-upload-action'></button>
</div>
</script>
<script>
$(document).ready(function () {
$("#files").kendoUpload({
multiple: true,
async: {
saveUrl: "NewFolder.aspx/UploadSubSRFiles",
removeUrl: "Remove",
autoUpload: false
},
upload: onUpload,
template: kendo.template($('#fileTemplate').html())
});
function onUpload(e) {
var paramsEmailDocs = "{'files':'" + JSON.stringify(e.files) + "'}"
$.ajax({
type: "POST",
url: urlUploadFile,
data: paramsEmailDocs,
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (data) {
}
})
}
});
</script>
我想拥有所选文件的文件路径。
当我们查看 e.files 时,我们得到扩展名、文件名、大小,但没有文件路径。我怎么才能得到它。任何帮助将不胜感激。