zoukankan
html css js c++ java
.net 下实现下载
System.IO.FileInfo file
=
new
System.IO.FileInfo(Server.MapPath(
"
~/upFile/abc.rar
"
));
Response.Clear();
Response.AddHeader(
"
Content-Disposition
"
,
"
attachment; filename=
"
+
HttpUtility.UrlEncode(file.Name));
Response.AddHeader(
"
Content-Length
"
, file.Length.ToString());
Response.ContentType
=
"
application/octet-stream
"
;
Response.WriteFile(file.FullName);
Response.End();
把fileInfo的参数改为数据库中读出来的下载路径即可
查看全文
相关阅读:
selenium的持续问题解决
为什么使用Nginx
[转]性能测试场景设计深度解析
[转]CentOS7修改时区的正确姿势
[转]利用Fiddler模拟恶劣网络环境
[转]什么是微服务
[转] WebSocket 教程
[转] Python实现简单的Web服务器
shell修改配置文件参数
[转] linux shell 字符串操作(长度,查找,替换)详解
原文地址:https://www.cnblogs.com/yangbin1005/p/991317.html
最新文章
sqlserver 修改表结构提示阻止
Invoke
mvc dropdown
Net User 命令
System.Xml.XPath.XPathException
TcpIp
get--ip
跨域获取json电商数据
SQL語句性能比較
转(Check Null Before Adding into list)
热门文章
文件上传怎么测试
题记
白盒测试day03
白盒测试day02
白盒测试day01
软件测试的数据库技术02
软件测试的数据库技术01
git安装与使用
shell语法
Linux常用软件安装
Copyright © 2011-2022 走看看