if(File.Exists(finalFilePath.ToString()))
{
try
{
HttpContext hc = HttpContext.Current;
hc.Response.Clear();
hc.Response.Charset = ConfigSettings.Create().GetEncoding().ToString();
hc.Response.Buffer= true;
hc.Response.ContentEncoding = ConfigSettings.Create().GetEncoding();
hc.Response.AppendHeader("Content-Disposition","attachment;filename=" + str_fileName.ToString());
hc.Response.WriteFile(finalFilePath.ToString());
hc.Response.Flush();
hc.Response.Close();
}
finally
{
File.Delete(finalFilePath.ToString());
}
}