Mailing List
Home
Forum Home
Maven - Project building tool
Axis - Java SOAP implementation
Cocoon - MVC web framework based on XML/XSL
Lucene - Full-featured text search engine APIs
Log4J - A log library
Fop - Create PDF, PCL, PS, SVG, XML driven by XSL formatting objects.
POI - Java Excel, Word and other Microsoft Office files manipulating library
Oracle database error code ...
Subjects
log4j warning: No appenders could be found
java security AccessControlException: access denied (java io FilePermission clie
java lang InstantiationException: org apache tools ant Main
Apache Axis Tutorial
Struts <logic iterate >
log4j properties How to parse outpu to multiple files
configuring log4j with BEA Weblogic 8 1
How to use XSL FOP Java together
JSP precompile
Servlet File Download dialog problem (IE6,Adobe 6 0)
Proposal: Adding jar manifest classpath in jar and war plugins
Unsupported major minor version 48 0 problem while running the an
   telope task
java security AccessControlException: access denied (java io FilePermission
axis wsdl2java Ant Task usage
net sf hibernate MappingException: Error reading resource: test/User hbm xml
Building EAR ANT Script for websphere 5 0
CREATING WAR Files
jsp data into Excel
Classpath problem
Jboss 3 2 3+ vs Tomcat Axis Question
RE: How to include jars and add them into the MANIFEST MF/Class Path
attribute
Printing problem
InstantiationException
Couldn 't find trusted certificate
Please : How can one install ant 1 6 0 under Eclipse 2 1 ?
Excel: Too many different cell formats
Running junit tests fails
XDoclet, Struts and Maven: Where to start? SOLUTION
1 3 final: now giving me java io FileNotFoundException (Too many
open files)
AXIS: tomcat timeout ?
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Servlet File Download dialog problem (IE6,Adobe 6.0)

Servlet File Download dialog problem (IE6,Adobe 6.0)

2003-12-01       - By Daniel Easton

 Back
Reply:     1     2     3     4  

Hi Jason,

I also had problems displaying my pdf's.  I've got the following headers
defined:

Content-type: application/pdf
Content-Disposition: inline; filename=report.pdf

I also calcuate the length of the file and set

Content-length: x

where x is the length of the string stream of the pdf

There's also something called accept ranges (mine is set to bytes ??) which is
IE 6 only (but not sure what it is, try http://msdn.microsoft.com/library
/default.asp?url=/workshop/author/dhtml/reference/constants/response_headers.asp
)

Good Luck :-)

Daniel
 -- -- Original Message -- --
 From: Jason Smith
 To: fop-user@(protected)
 Sent: Sunday, November 30, 2003 2:04 AM
 Subject: Re: Servlet File Download dialog problem (IE6,Adobe 6.0)


 Thanks for the response.  I am setting the content type to "application/pdf".
 It also does not seem to matter if I include the x=dummy.pdf parameter or not.
 It still works the same.  The first time it attempts the download, the next
time works like a charm.

 Chris Pratt <chrisp@(protected)> wrote:
   Make sure that you set the content type to "application/pdf".
     (*Chris*)
     -- -- Original Message -- --
     From: Jason Smith
     To: fop-user@(protected)
     Sent: Saturday, November 29, 2003 3:37 PM
     Subject: Servlet File Download dialog problem (IE6,Adobe 6.0)


     I'm new to FOP.  I'm trying to dynamically create a PDF from a struts web
application.  In my action bean I execute a JSP URL that returns the FOP xml.
I take the return stream and place it into a reader and then pass it to
renderFO method from the example servlet.

     This seems to work like I want it to.  However, I'm running into an issue
with IE.  Whenever I input the URL for my action bean, the first time through I
get the "File Download window".  The file type is "Adobe Acrobat Control for
ActiveX".  If I cancel and then resubmit the very same URL, the PDF is
displayed.

     I have read the FAQ and several messages about problems with IE but have
not run across my exact problem.  In them they say to include a dummy.pdf at
the end of the URL.  And to include a PDF extension as part of the base URL.  I
have done both but still have the issue.

     I have tried various URLs including:

     ....IncidentPDFPath.do?incidentSID=123245&x=dummy.pdf
     ....IncidentPDFPath.pdf?incidentSID=123245&x=dummy.pdf

     With the same results.

     The funny thing is the second time I submit the URL from the browser it
works.  If I open a new browser and submit it I get the "File Download" window
again the first time.  The second time from the same browser the PDF is
displayed.

     Thanks for any help.


     Jason Smith
     Project Refinery
     www.projectrefinery.com
     jsmith@(protected)


 Jason Smith
 Project Refinery
 www.projectrefinery.com
 jsmith@(protected)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Jason,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I also had problems displaying my pdf's.&nbsp; I
've
got the following headers defined:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Content-type:
application/pdf<BR>Content-Disposition: inline; filename=report.pdf</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I also calcuate the length of the file and
set</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Content-length: x</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>where x is the length of the string stream of the
pdf</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>There's also something called accept ranges (mine
is set to bytes ??) which is IE 6 only (but not sure what it is, try <A
href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml
/reference/constants/response_headers.asp">http://msdn.microsoft.com/library
/default.asp?url=/workshop/author/dhtml/reference/constants/response_headers.asp
</A>)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Good Luck :-)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Daniel</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT:
#000000 2px solid; MARGIN-RIGHT: 0px">
 <DIV style="FONT: 10pt arial">-- -- Original Message -- -- </DIV>
 <DIV
 style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
 <A title=jsmith@(protected)
 href="mailto:jsmith@(protected)">Jason Smith</A> </DIV>
 <DIV style="FONT: 10pt arial"><B>To:</B> <A title=fop-user@(protected)
 href="mailto:fop-user@(protected)">fop-user@(protected)</A> </DIV>
 <DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, November 30, 2003 2:04
 AM</DIV>
 <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: Servlet File Download
dialog
 problem (IE6,Adobe 6.0)</DIV>
 <DIV><BR></DIV>
 <DIV>Thanks for the response.&nbsp; I am setting the content type to
 "application/pdf".&nbsp; It also does not seem to matter if I include the
 x=dummy.pdf parameter or not.&nbsp; It still works the same.&nbsp; The first
 time it attempts the download, the next time works like a
 charm.<BR><BR><B><I>Chris Pratt &lt;<A
 href="mailto:chrisp@(protected)">chrisp@(protected)</A>&gt;</I></B>
 wrote:
 <BLOCKQUOTE class=replbq
 style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
   <META content="MSHTML 6.00.2800.1276" name=GENERATOR>
   <STYLE></STYLE>

   <DIV><FONT size=2>Make sure that you&nbsp;set the content type to
   "application/pdf".</FONT></DIV>
   <DIV><FONT size=2>&nbsp; (*Chris*)</FONT></DIV>
   <BLOCKQUOTE
   style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT
: #000000 2px solid; MARGIN-RIGHT: 0px">
     <DIV style="FONT: 10pt arial">-- -- Original Message -- -- </DIV>
     <DIV
     style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:
</B>
     <A title=jsmith@(protected)
     href="mailto:jsmith@(protected)">Jason Smith</A> </DIV>
     <DIV style="FONT: 10pt arial"><B>To:</B> <A title=fop-user@(protected)
     href="mailto:fop-user@(protected)">fop-user@(protected)</A> </DIV>
     <DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, November 29, 2003
     3:37 PM</DIV>
     <DIV style="FONT: 10pt arial"><B>Subject:</B> Servlet File Download
dialog
     problem (IE6,Adobe 6.0)</DIV>
     <DIV><BR></DIV>
     <DIV>I'm new to FOP.&nbsp; I'm trying to dynamically create a PDF from a
     struts web application.&nbsp; In my action bean I execute a JSP URL that
     returns the FOP xml.&nbsp; I take&nbsp;the return stream and place it
into
     a reader and then pass it to renderFO method from the example
     servlet.</DIV>
     <DIV>&nbsp;</DIV>
     <DIV>This seems to work like I want it to.&nbsp; However, I'm running
into
     an issue with IE.&nbsp; Whenever I input the URL for my action bean, the
     first time through I get the "File Download window".&nbsp; The file type
     is "Adobe Acrobat Control for ActiveX".&nbsp; If I cancel and then
     resubmit the very same URL, the PDF is displayed.</DIV>
     <DIV>&nbsp;</DIV>
     <DIV>I have read the FAQ and&nbsp;several messages about problems with IE
     but have not run across my exact problem.&nbsp; In them they say to
     include a dummy.pdf at the end of the URL.&nbsp; And to include a PDF
     extension as part of the base URL.&nbsp; I have done both but still have
     the issue.</DIV>
     <DIV>&nbsp;</DIV>
     <DIV>I have tried various URLs including:</DIV>
     <DIV>&nbsp;</DIV>
     <DIV>
     <DIV>....IncidentPDFPath.do?incidentSID=123245&amp;x=dummy.pdf</DIV>...
.IncidentPDFPath.pdf?incidentSID=123245&amp;x=dummy.pdf</DIV>
     <DIV>&nbsp;</DIV>
     <DIV>With the same results.</DIV>
     <DIV>&nbsp;</DIV>
     <DIV>The funny thing is the second time I submit the URL from the browser
     it works.&nbsp; If I open a new browser and submit it I get the "File
     Download" window again the first time.&nbsp; The second time from the
same
     browser the PDF is displayed.</DIV>
     <DIV>&nbsp;</DIV>
     <DIV>Thanks for any help.</DIV><BR><BR>Jason Smith<BR>Project
     Refinery<BR>www.projectrefinery.com<BR>jsmith@(protected)<
/BLOCKQUOTE></BLOCKQUOTE></DIV><BR><BR>Jason
 Smith<BR>Project
 Refinery<BR>www.projectrefinery.com<BR>jsmith@(protected)</BLOCKQUOTE
></BODY></HTML>

Earn $52 per hosting referral at Lunarpages.