Content-Disposition屬性有兩種類型:inline 和 attachment
inline :將文件內容直接顯示在頁面
attachment:彈出對話框讓用戶下載
code:
context.Response.ContentType = "text/plain";
string fileName = context.Request["fileName"];
if(fileName!=null)
{
context.Response.AddHeader("Content-Disposition", "attachment;filename="+fileName);
context.Response.WriteFile("downLoad/" + fileName);
}
