How to click Download to directly download known types of files from the client browser
Click the link to download the file and click it to download it directly instead of opening it.
When writing a download link, how can I directly download txt, Doc, xls, and other text files without opening the link?
Click "Connect" to download the. txt file directly.
The methods found on the Internet are to use FSO stream to read files and modify the HTTP headers method, which is troublesome and inefficient.
There is a m http headers option in IIS, which can be modified directly.Content-DispositionIsAttachmentYou can.
Example: http://www.mianbi.com/book/a2165bec-a644-4ad3-b2ca-77a8662ff3f6.txt
Microsoft provides a way to override this "stream now" behavior at the server side using a custom HTTP header in IIS. to add the custom header, launch Internet Information Services Manager and expand your web sites to reveal the folder where multimedia content is stored. right-click this folder and choose Properties. click the HTTP headers tab, followed by the Add button.
For the custom header name type:Content-Disposition
For the custom header value type:Attachment
Click OK, click Apply, click OK.
Visit one of the web pages linking to your content download and test the links. You shoshould be presented with the Save As dialog.
There is a catch to this solution. by setting the content-Disposition for the entire folder, your server will pop the Save As dialog box for any file called by a Web browser, including web pages. there are two ways to solve this problem: only store media files in the folder where you modify the content-disposition or set the attribute on-the-fly using code.
From: http://www.jakeludington.com/windows_media_server_admin/20041209_using_custom_http_headers_to_prompt_for_video_file_downloads.html