You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Lauralyn Ninow <La...@comtrol.com> on 2003/04/07 20:08:28 UTC

RE: [users@httpd] RE: IE6+Adobe Reader 5 will not open a PDF File from CGI app

hmm.  I'll just tell you what I did.

I didn't user the Location header. I had problems with HUGE ( upto 73 Meg)
files that I needed to send to the customer, so I did it by writing binary
chunks. ASP snippet:

		Response.ContentType = objF.ContentType(objF.FileExtension)
'this is my lookup for the proper ContentType
		Response.AddHeader "Content-Disposition", "filename=" &
objF.ShortName
		response.AddHeader "Transfer-Encoding", "binary"
'added
		response.addheader "Connection", "Close"	'added
		Response.AddHeader "Content-Length", fsize

		objF.Chunksize = ChunkSize
		For lngBytesRead = 0 To fsize Step ChunkSize
			If lngBytesRead + ChunkSize > fsize Then
					Exit For
			end if
'			objF.SeekRelative lngBytesRead  'start where we left
off.
			response.binarywrite objF.ReadBytes()
		Next
		'perform last read
		If lngBytesRead + ChunkSize > fsize Then
			objF.ChunkSize = (fsize - lngBytesRead)
'			objF.SeekRelative lngBytesRead  'start where we left
off.
			response.binarywrite objF.ReadBytes()
		End If
		Response.Flush
		objF.CloseFile

Hope that helps.
Lauralyn

> -----Original Message-----
> From: Andres [mailto:eetasoft@online.ee]
> Sent: Sunday, April 06, 2003 1:44 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] RE: IE6+Adobe Reader 5 will not open a PDF File
> from CGI app
> 
> 
> Lauralyn, thank you for assistanse.
> 
> According to this, I make two attemps (two returning two 
> different set of
> headers from CGI) to return pdf file to IE 6 from a CGI app, 
> but without
> success.
> Empty browser window appears. PDF is not displayed.
> 
> ATTEMPT 1
> 
> Content-type: application/pdf
> Content-Disposition: inline,filename=_0x9123445.pdf
> Location: /eeva/_0x9123445.pdf
> 
> Result access log:
> 
> 127.0.0.1 - - [06/Apr/2003:21:14:16 +0300] "POST
> /eeva/eva.exe/PrintRun.pdf?Type=P&SubType=P&Id=&Form=LAOSEIS 
> HTTP/1.1" 200
> 5555
> 
> ATTEMPT 2
> 
> Status: 302 Moved
> Content-Disposition: inline,filename=_0x919czwm.pdf
> Location: /eeva/_0x919czwm.pdf
> 
> Result access log:
> 
> 127.0.0.1 - - [06/Apr/2003:21:09:48 +0300] "POST
> /eeva/eva.exe/PrintRun.pdf?Type=P&SubType=P&Id=&Form=LAOSEIS 
> HTTP/1.1" 302 0
> 127.0.0.1 - - [06/Apr/2003:21:09:52 +0300] "GET /eeva/_0x919czwm.pdf
> HTTP/1.1" 200 5555
> 
> Additional info:
> 
> 1. Some PDF files are displayed and some not. It seems that 
> this is related
> to
>  PDF file contents-CGI-Apache combination.
> If i use other web server which servers the same pdf files 
> without CGI, all
> pdf files are displayed in IE 6 !
> 
> 2. After pressing Refresh button and answering Retry, my CGI 
> app receives a
> GET request instead of original POST request.
> 
> 
> Any help ?
> 
> >From: Lauralyn Ninow <La...@comtrol.com>
> >you have to provide the filename in the header for it to work in IE.
> 
> >(sorry, this is asp code:)
> >Response.AddHeader "Content-Disposition", "filename=" & 
> objF.ShortName
> 
> 
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>