加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

.NET中的FileUpload控件的使用-原生JS(二)

发布时间:2020-12-15 21:27:03 所属栏目:asp.Net 来源:网络整理
导读:本篇使用原生JS进行数据传输,使用FileUpload控件上传文件,适配IE。 HTML = > = > formenctype= id= multiple name= /> = id= >点我上传 JS opt = opt || opt.method = (opt.method || opt.url = opt.url || opt. = opt. || opt.contentType = opt.contentT

本篇使用原生JS进行数据传输,使用FileUpload控件上传文件,适配IE。

HTML

=>
=> formenctype= id= multiple name= />

JS

opt = opt || opt.method = (opt.method || opt.url = opt.url || opt. = opt. || opt.contentType = opt.contentType || ; opt.processData = opt.processData || ; opt.data = opt.data || opt.success = opt.success || opt.error = opt.error || xmlHttp = xmlHttp = } xmlHttp = ActiveXObject( (opt.method.toUpperCase() === xmlHttp.open(opt.method,opt.url,opt.); } (opt.method.toUpperCase()=== xmlHttp.open(opt.method,opt.url + + opt.data,opt. xmlHttp.onreadystatechange = (xmlHttp.status == && xmlHttp.readyState == } }

后台逻辑

files = Request.Files.AllKeys.Distinct(); (files != ( each HttpPostedFileBase file = Request.Files[each] HttpPostedFileBase; (file != InputFileName = str4 = AppDomain.CurrentDomain.BaseDirectory; ServerSavePath = Path.Combine(Server.MapPath( (!Directory.Exists(ServerSavePath)) SavePath = }

感谢您的观看,您的

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读