Sady Home

Note my coding life

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
When we develop a function to let client download the files not directly open in the internet explorer,
there are two ways. One is coding an intergrade file under reading and writing binary file, such as:
  Response.expires = 0 
  Response.expiresabsolute = Now() - 1 
  Response.addHeader "pragma","no-cache" 
  Response.addHeader "cache-control","private" 
  Response.Buffer  = True
  Response.Clear
  Response.ContentType = "application/octet-stream"
  Response.AddHeader "Content-Disposition", "attachment;filename=*****" 
  Response.BinaryWrite bytFileBytes
 
The other one we should do the setting of server. We need to delete "content-type:text/html; charset=*****" in Custom HTTP Headers of IIS. But this is not intergrant, I think.
posted on 2007-10-12 08:33  Sady  阅读(188)  评论(0)    收藏  举报
凭飞堂