Hi All,

  The below code is used to download the files from our .net coding...

#region downloadfile



public static bool downloadfile(string filename, string path)


{


try


{


FileStream sourceFile;


HttpResponse response = HttpContext.Current.Response;


response.ContentType = "application/x-rar-compressed";


response.AddHeader("content-disposition", "attachment; filename=" + filename + Path.GetExtension(path).ToString());


sourceFile = new FileStream(path, FileMode.Open);


long FileSize;


FileSize = sourceFile.Length;


byte[] getContent = new byte[(int)FileSize];


sourceFile.Read(getContent, 0, (int)sourceFile.Length);


sourceFile.Close();


sourceFile.Dispose();


response.BinaryWrite(getContent);


response.Flush();


response.Clear();


response.Close();


return true;


}


catch (Exception ex)


{


return false;


}


}


#endregion
 
 
 Happy Coding!!!!!!!