我正在使用 Kendo UI 上传来上传单个/多个文件。 我已经实现了它,
<input name="file" id="files" type="file" />
<script type="text/javascript">
$(document).ready(function () {
$("#files").kendoUpload({
async: {
saveUrl: "/NewFile/upload",
autoUpload: false,
},
});
});
</script>
在 Controller 中,我给出了类似的内容,
public ActionResult upload(HttpPostedFileBase file)
{
//Code for saving in DB
return???
}
我能够将记录保存在数据库中,但它显示为“重试”并显示未成功上传。所以您能告诉我必须使用什么返回语句来显示正确的上传状态吗?
最佳答案
您应该返回空响应:
public ActionResult upload(HttpPostedFileBase file)
{
// Code to save in DB
// Return an empty string to signify success
return Content("");
}
关于javascript - Kendo UI uploader 服务器端的返回语句是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13984606/