string st, doctitle;
doctitle = e.CommandArgument.ToString();
st = Server.MapPath("../documents") + "//" + doctitle;
FileInfo f = new FileInfo(st);
if (f.Exists == true)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=" + f.Name);
Response.AddHeader("content.length", f.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(f.FullName);
Response.End();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment