首页
编程教程
编程导航
编程百科
编程问答
编程博文
编程实例
硬件设备
网络运营
软件教程
移动数码
办公软件
操作系统
人工智能
.NET中的FileUpload控件的使用-原生JS(二)
asp.Net
2019-02-03
本篇使用原生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.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 =
}
感谢您的观看,您的
相关文章
.net6 使用gRPC示例
### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
.Net 6 SignalR 实际业务开发中遇到的问题及解决办法
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目部署到 Linux 系统上的 Docker 容器
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
PowerDesigner与UML建模应用
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
分页存储过程的使用
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
.NET中应用Ueditor(富文本编辑)的配置和使用
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....