Recently done Web site project encountered the function of downloading, file format is diverse, this thought directly to the virtual path assignment to the link on the line, did not expect to test the time to find pictures, text and PDF files are automatically opened in Firefox, there is no popup download box. Find a good way to solve this problem today.
After the website is published, configure it in IIS. The steps are as follows:
1. Locate your published Web site in the Web site of the tree directory on the left side of IIS, and select the directory where the downloaded files are located;
2. Find the "HTTP response header" option, double-click to open;
3. Click "Add" button, in the Pop-up dialog box "name" field input: Content-disposition in the "Value" column input: Attachment click OK.
OK, so that you can access the file when the dialog box, do not set in the site root, or access to any one file will prompt the download.
ASP. NET Web Click Link Direct download not open in browser