会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
过江的博客
博客园
首页
新随笔
管理
订阅
上传和下载
//
上传:
用个FileUpload1控键
string
sFileName;
sFileName
=
FileUpload1.FileName;
string
sFilePath
=
Server.MapPath(
"
File
"
);
string
strPath
=
System.IO.Path.Combine(sFilePath, FileUpload1.FileName);
FileUpload1.PostedFile.SaveAs(strPath);
//
下载:
string
filepath
=
Server.MapPath(
"
File
"
);
string
filename
=
//
下载文件名;
string
path
=
filepath
+
filename;
Response.Clear();
Response.ContentType
=
"
application/octet-stream
"
;
Response.AddHeader(
"
Content-Disposition
"
,
"
attachment;FileName=
"
+
HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8));
Response.WriteFile(path);
Response.End();
posted on
2006-06-23 15:53
过江
阅读(
293
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告