Author: ZarrinPour | Posted on: 10/10/2008 1:07:49 PM | Views : 901

Hi all
I have used the following code to show "Save As"Dialog to user for downloading a file:

         Response.ContentType =  I will fill this property based on the file type

         string filename= I will fill this variable from database...it's a nvarchar value in Sql Server

         Response.AddHeader("content-disposition", "attachment; filename=" +filename);
         
         FileStream sourceFile = new FileStream(Server.MapPath(.....Path to the target file...)   , FileMode.Open);
         long FileSize;
         FileSize = sourceFile.Length;
         by ...

Go to the complete details ...