0
A
回答
0
退房的KendoUI上传的配置文档:http://www.kendoui.com/documentation/ui-widgets/upload/configuration.aspx
异步对象上的saveUrl选项允许您设置为提交的文件(S),轻松处理程序。
3
下面是我们提出的动态更改Kendo UI上传小部件上的saveUrl的解决方案。
控制器代码:
public class MediaController : ApiControllerBase
{
public Task<HttpResponseMessage> Post()
{
var queryVals = Request.RequestUri.ParseQueryString();
string idValue = queryVals["id"].ToString();
... CODE REMOVE FOR BREVITY
}
}
和脚本代码:
<div style="width:45%">
<input class="upload" name="files" id="files" type="file" upload-id="02ebeebf-98aa-459b-b41f-49028fa37e9c" />
<input class="upload" name="files2" id="file1" type="file" upload-id="499499D3-1C80-4930-8C8D-C87F17884D3F" />
</div>
<script>
$(document).ready(function() {
$(".upload").kendoUpload({
async: {
saveUrl: "/API/Media",
autoUpload: true
},
upload: function onUpload(e) {
var uploadId = e.sender.wrapper.prevObject.attr("upload-id");
e.sender.options.async.saveUrl = "/api/media?id=" + uploadId;
},
});
});
</script>
相关问题
- 1. Safari上的Kendo UI文件上传 - 上传文件的问题
- 2. Kendo UI使用ASP.NET MVC上传文件大小限制?
- 3. kendo ui上传验证
- 4. Kendo UI上传控件 - saveField和saveUrl
- 5. Kendo UI文件上传在同步模式下删除文件
- 6. Kendo上传访问文件?
- 7. Kendo上传不上传文件
- 8. 角2的Kendo UI上传组件 - 无法上传
- 9. 如何以编程方式上传使用kendo UI上传部件的页面上的文件
- 10. Kendo UI上传,上传文件后如何获取路径url成功
- 11. Kendo UI上传异步错误
- 12. 通过Kendo上传文件,Webservice
- 13. Kendo UI框架:上传组件不显示在iPad上上传的选项
- 14. Kendo UI上传服务器上的重命名文件并更新客户端
- 15. 使用Durandaljs时的Kendo-UI组件
- 16. kendo ui上传,只限制1个文档
- 17. 使用Kendo UI与sencha touch
- 18. Kendo UI不使用流星?
- 19. Kendo UI + AngularJS + treeview +上下文菜单
- 20. 如何删除kendo ui中的删除按钮上传文件名
- 21. kendo ui imagebrowser默认图像文件夹
- 22. 如何使用kendo-UI打开外部Angularjs html文件
- 23. 我可以将Visual Studio 2010用于Kendo UI,Kendo UI Web或Kendo UI Mobile吗?
- 24. 使用blueimp上传文件上传东西blueimp文件上传
- 25. 使用kendo ui框架的MVVM使用
- 26. Kendo ui空文本框
- 27. 如何重置上传的文件列表在Kendo Angular上传组件
- 28. 如何使用Kendo UI将参数传递给HttpHandler?
- 29. 在jQuery UI对话框中无法使用文件上传
- 30. 使用jquery文件上传插件并行块文件上传
这行代码救了我的一天:e.sender.options.async.saveUrl =“/ API /媒体ID =“+ uploadId;谢谢。 – 2016-03-22 13:47:28