DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 08 Aug 2007 16:48:55 -0000,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    pthawkes


IE6 and PDF download issues...Change page headers   
Hello

I am having problems downloading a pdf file that I generate on the
fly. The file download will work in IE7 and Firefox, but not in IE6 as
per this post  http://drupal.org/node/93787

I am trying to change my headers as the post suggests, with the code
below ...I run this in Firefox with the firebug add-on so that I can
capture the header information sent to the browser and only some of
the setting are changed and it seems to ignore the request that I am
making. Could anyone shed some light on this???

Basically I'm trying to set the Cache-Control to private and the
Pragma to cache

'##############################
'Start Code Snippet
'############################


Private Sub DoDownload(ByVal theFile As String)
                           'FileStream object read file from Local
Drive
                Dim streamObj As FileStream =
File.OpenRead(Server.MapPath(theFile))
                'Store File in Buffer
                Dim buffer(CInt(streamObj.Length)) As Byte
                'Read File from Buffer
                streamObj.Read(buffer, 0, buffer.Length)
                'Close FileStream Object Set its Value to nothing
                streamObj.Close()
                streamObj = Nothing

                Response.Expires = 0
                Response.ContentType = "application/pdf"
                Response.AppendHeader("Content-length",
buffer.Length.ToString())
                Response.AppendHeader("Content-Disposition:",
"attachment; filename=Your_File.pdf")
                Response.AppendHeader("Pragma", "Cache")
                Response.AppendHeader("Cache-control", "private")
                Response.OutputStream.Write(buffer, 0, buffer.Length)
               Response.OutputStream.Flush()
         Try
                Response.End()
         Catch ex As Exception
          End Try

'##############################
'End Code Snippet
'############################
'##############################
' Start Response Headers
'############################

Date	Wed, 08 Aug 2007 16:28:26 GMT
Server	Microsoft-IIS/6.0
X-Powered-By	ASP.NET
X-AspNet-Version	2.0.50727
Content-Length	145563
content-disposition	: attachment; filename=Your_File.pdf
Pragma	Cache, no-cache
Set-Cookie	COOKIETIMER=08/08/2007 17:28:14; path=/ COOKIETIMER=08/
blah...blah blah
Cache-Control	no-cache
Expires	-1
Content-Type	application/pdf

##############################
' End Response Headers
'############################
Date:Wed, 08 Aug 2007 16:48:55 -0000   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us