Multipurpose Internet Mail Extensions (MIME) is a wonderful thing,
allowing your Web browser to automatically display content of many
different formats natively within the browser window. However,
sometimes, you may want users to download this content to their
client computer rather than simply viewing it in the browser. But
how do you override the browser's determination to render known
MIME types itself? The answer is to use a content disposition
header in your Web page.
Suppose you've written an ASP page that contains a link to a known
MIME type, but you want the user to download the file instead of
viewing it. Add the following to your script:
response.addHeader "content-disposition", "attachment;
Then substitute the actual filename and extension, and it's as good
filename=filename.ext"
as done. When your users click on the link, they'll immediately see
the download dialog box instead of the file's contents.
Force 'file download' for known file types
By ElementK Journals, published on 14 Jul 2001
| Filed in
You might also like...
ASP (3.0) forum discussion
-
About software training for beginner
by sudarshan380 (0 replies)
-
How to convert varchar to numeric
by rajrprk (0 replies)
-
In And Out Of My Golf Game ?
by pukiy2011 (0 replies)
-
Rip Blu-ray to Transformer Prime-Mac Blu-ray to Transformer Prime Converter
by tomjason9 (0 replies)
-
SENDING TEXT MESSAGES TO MOBILE PHONES FROM A WEBPAGE USING ASP.NET 1.1
by simonnjoroge2000@yahoo.com (0 replies)
ASP (3.0) podcasts
-
Microsoft MSDN Videos: New Web Developer features in VS 2010
Published 1 year ago, running time 0h0m
Mike Ormond, from Microsoft's Developer and Platform Group, gives a session on the top 10 items that developers might be interested in learning more about in Visual Studio 2010 and ASP.net.
Comments