Author: SALJOO | Posted on: 3/4/2010 10:30:28 AM | Views : 498

hi all , how r u?
i have 2 questions:
i have( Files.aspx) which contain a datalist of files names , when u click on file name , the user redirect to
new page with the fileID as the parameter of that file as follow:
DownLoadFile.aspx?FileID=112
on Page Load event of this page i have get File DaTa and File name of that file based on FileID attached with queryString
and then type this Function to Download File as follow:
private void download (DataTable dt)
{
    Byte[] bytes = (Byte[])dt.Rows[0]["Data"];
    Response.Buffer = true;
    Response.Charset = "";
    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    Response.AddHeader("content-disposition", "attachment;filename="
    + dt.Rows[0]["Name"].ToString());
&nbs ...

Go to the complete details ...