private void DownloadFile(string path, bool forceDownload) { string name = Path.GetFileName(path); string type = "text/plain"; if (forceDownload) { Response.AppendHeader("content-disposition", "attachment; filename=" + name); } if (type != "") { Response.ContentType = type; } Response.WriteFile(path); Response.End(); bll.RemoveFile(path); }