// Identify the file to download including its path. string filepath = DownloadFileName; // Identify the file name. string filename = System.IO.Path.GetFileName(filepath); Response.Clear(); // Specify the Type of the downloadable file. Response.ContentType ="application/octet-stream"; // Set the Default file name in the FileDownload dialog box. Response.AddHeader("Content-Disposition", "attachment; filename="+ filename); Response.Flush(); // Download the file. Response.WriteFile(filepath);