会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
:: ::
博问
::
闪存
:: ::
联系
:: ::
管理
::
下载
String StrName
=
System.IO.Path.GetFileName(TObj.ClientFilePath);
String StrPath
=
MapPath(Request.ApplicationPath
+
TObj.VirtualFilePath);
FileStream fileStream
=
new
FileStream(StrPath, FileMode.Open);
long
fileSize
=
fileStream.Length;
Context.Response.ContentType
=
"
application/octet-steam
"
;
Context.Response.AddHeader(
"
Content-Disposition
"
,
"
attachment; filename=\
""
+ HttpUtility.UrlEncode(StrName, System.Text.Encoding.UTF8) +
"
\
"
;
"
);
Context.Response.AddHeader(
"
Content-Length
"
,fileSize.ToString());
byte
[] fileBuffer
=
new
byte
[fileSize];
fileStream.Read(fileBuffer,
0
, (
int
)fileSize);
Context.Response.BinaryWrite(fileBuffer);
Context.Response.End();
posted on
2006-02-08 17:24
dtor
阅读(
253
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部