Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Re: force download


Message #1 by "Julian Moorhouse" <jmoorhouse@a...> on Thu, 2 May 2002 06:12:28
> Response.ContentType="text/octet-stream"
> Response.AddHeader "content-
disposition","attachment;filename=yourfile.xls"
> 
> Hope this helps
> 
> Hugh
> 

If you use the above, it will force a save dialogue but....

When IE saves it to disk, IE does not attach the extension (.xls), so 
after saving, it will simply show as being an unknown filename. Even 
though we know it is an excel spreadsheet,the downloader my not and even 
if the downloader does, he/she has the inconvenience of adding .xls onto 
the end of the filename).

If you use the following, the save dialogue will still show up, but IE 
will attach the extension .xls onto the end of it.

Response.ContentType="application/vnd.ms-excel"
Response.AddHeader "content-disposition","attachment;filename=Filename.xls"

Cheers,
Julian.

  Return to Index