In the download of website attachments, we often do not directly expose the storage address of attachments, such: <a href = 'file/test.doc '> my successful copies </a> when you click Download, the link is http: // 192.169.1.87/file/test.zip is not good enough. It's too straightforward. We can use Response. the WriteFile output method to hide the path and change it to http: // 192.169.1.87/dowfile. aspx? Fid = 13. In the system, we often store the attachment information in the data table, such as the file name, path, and file format. If you have obtained the file name and storage path [csharp] string fileName = "My succeeded can be copied"; string filePath = "2013/2/22/test.zip "; string fileUrl = "D: // file/" + filePath; if (! System. IO. file. exists (fileUrl) {Response. write ("no file"); return;} Response. clear (); Response. buffer = true; Response. appendHeader ("Content-Disposition", "attachment; filename =" + fileName); Response. writeFile (fileUrl); Response. end ();