ASP. NET Web Click Link Direct download not open in browser

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.