string
strFileName
=
Request[
"
FileName
"
];
string strPath = Server.MapPath( @" WorkItemXml " ) + " / " ;
Response.ContentType = " image/jpeg " ;
Response.AddHeader( " Content-Disposition " , " attachment;FileName= " + HttpUtility.UrlEncode(strFileName, Response.HeaderEncoding));
Response.TransmitFile(Server.MapPath( @" images/ " + strFileName));
Response.End();
string strPath = Server.MapPath( @" WorkItemXml " ) + " / " ;
Response.ContentType = " image/jpeg " ;
Response.AddHeader( " Content-Disposition " , " attachment;FileName= " + HttpUtility.UrlEncode(strFileName, Response.HeaderEncoding));
Response.TransmitFile(Server.MapPath( @" images/ " + strFileName));
Response.End();
可以直接下载文件。