kendoUpload
<style> .upfile { display: inline-block; width: 40%; } .upfile li { display: inline-block; width: auto; margin:0px; } .upfile li input { width:100%; } .upfile li h4 { color: #999; font-weight: normal; margin:0px;} </style> <form action="javascript:void(0);" id="file_edit" > <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel"></h4> </div> <div class="modal-body"> <div class="form-group"> <label>上传文件:</label> <ul class="upfile k-block"> <li> <input type="file" id="fileAux" name="fileAux" data-fid="" /> </li> <li> <h4 id="fuAuxMsg"></h4> </li> </ul> </div> </div> <div class="alert alert-danger alert-dismissible fade in" role="alert" id="errMsg" style="display:none"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button> </div> </form> <script> $("#fileAux").kendoUpload({ localization: { select: "选择文件", dropFilesHere: "", headerStatusUploaded: "", headerStatusUploading: "", statusUploading: "", uploadSelectedFiles: "" }, multiple: false, showFileList: false, async: { saveUrl: "/FX/File/UpLoad", autoUpload: true }, select: function (e) { var files = e.files; }, upload: function (e) { $("#errMsg").hide(); $("#fileAux").attr("data-fid", ""); $("#fuAuxMsg").html("<img src='/content/image/loading_80×10.gif' />"); }, success: function (e) { if (e.response != null) { if (e.response.SUCCESS) { $('#wndGeneralEdit').modal('toggle'); if ($("#grid_file").length > 0) $("#grid_file").data("kendoGrid").dataSource.read(); } else { $("#fileAux").attr("data-fid", ""); $("#errMsg").html("<strong>上传失败:</strong>" + e.response.MESSAGE); $("#errMsg").show({ duration: 200 }); } } $(".k-upload-status-total").remove(); }, error: function (e) { console.log("Er", e); } }); </script>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)