Active Server Pages (ASP) - Force File Download

Derek Stone
07-30-2002, 02:07 PM
If you need to force a visitor to download a file from your website (not display it in their browser or MIME associated application) you can send additional HTTP headers to do just that.


Response.AddHeader("Content-Disposition","attachment;
filename=filename.ext")


This is very useful when it comes to common file extensions, including .doc, .txt and .html that will all display in the client's browser without intervention.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum