You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Ashish Sharma (JIRA)" <ji...@apache.org> on 2008/05/15 09:28:05 UTC

[jira] Created: (WW-2647) result type stream issue with inline file download in IE6

result type stream issue with inline file download in IE6
---------------------------------------------------------

                 Key: WW-2647
                 URL: https://issues.apache.org/struts/browse/WW-2647
             Project: Struts 2
          Issue Type: Bug
          Components: Other
    Affects Versions: 2.0.11
         Environment: Tomcat 5.5.17 as web server
Using Eclipse 3.3 as IDE
            Reporter: Ashish Sharma


Hi,

 I am using struts 2.0.11.
 I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
 Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 

 Following is the result defined for my action.

 <result name="success" type="stream">
	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
	<param name="contentType">application/pdf</param>
	<param name="inputName">reportStream</param>
</result>

 However this code seems to work fine for both IE7 and Firefox 2.0

 Can you please look into this.

 Thanks,
Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2647:
--------------------------

    Fix Version/s: 2.1.3

> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>             Fix For: 2.1.3
>
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44304#action_44304 ] 

Jeromy Evans commented on WW-2647:
----------------------------------

The case of Content-Disposition has not effect.  I investigated this issue last year and created a custom Result to investigate every header combination.  

*My final advice is to NOT use inline disposition for PDFs.  Some users appreciate the "Open With or Save prompt".*

There are several IE issues if you really want an inline response:
1. The content length header MUST be present
2. the *request* URI must contain .pdf, irrespective of the filename.   ie. it must contain .pdf *anywhere* in the URI

About IE mimetype sniffing:
http://blogs.msdn.com/ie/archive/2005/02/01/364581.aspx
http://msdn.microsoft.com/en-us/library/ms775148.aspx

If you're using SSL, you need you need to ensure the PDF file is at least 8kb [1], include the Cache-Control: no cache header, include the Cache-Control: no store header, ensure your users are using IE6SP1+ and that they have the "save encrypted pages to disk checkbox turned off [2]

[1] http://support.microsoft.com/default.aspx?scid=kb;EN-US;321532
[2] http://support.microsoft.com/default.aspx?scid=kb;en-us;812935&Product=ie600

Still worth the effort?


> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>             Fix For: 2.1.3
>
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44305#action_44305 ] 

Dave Newton commented on WW-2647:
---------------------------------

And, once again, IE makes my day. -1 on the effort :/ Sheesh.

> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>             Fix For: 2.1.3
>
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Ashish Sharma (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashish Sharma updated WW-2647:
------------------------------

    Description: 
Hi,

 I am using struts 2.0.11.
 I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
 Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 

 Following is the result defined for my action.

 <result name="success" type="stream">
	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
	<param name="contentType">application/pdf</param>
	<param name="inputName">reportStream</param>
</result>

 However this code seems to work fine for both IE7 and Firefox 2.0

 Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:

HttpServletResponse response = ServletActionContext.getResponse();
response.reset();
response.setContentType("application/pdf");
response.setContentLength(l_data.length);
response.setBufferSize(l_data.length);
response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
OutputStream out = response.getOutputStream();
out.write(l_data);
out.flush();
response.flushBuffer();

 Can you please look into this.

 Thanks,
Ashish

  was:
Hi,

 I am using struts 2.0.11.
 I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
 Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 

 Following is the result defined for my action.

 <result name="success" type="stream">
	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
	<param name="contentType">application/pdf</param>
	<param name="inputName">reportStream</param>
</result>

 However this code seems to work fine for both IE7 and Firefox 2.0

 Can you please look into this.

 Thanks,
Ashish

        Summary: Result type stream issue with inline file download in IE6  (was: result type stream issue with inline file download in IE6)

> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown resolved WW-2647.
---------------------------

    Resolution: Fixed
      Assignee: Dave Newton

Seems we've done all we can here.

> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>            Assignee: Dave Newton
>             Fix For: 2.1.3
>
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Bob Tiernay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44221#action_44221 ] 

Bob Tiernay commented on WW-2647:
---------------------------------

One difference I see in StreamResult.java is the header name:

oResponse.addHeader("Content-disposition", conditionalParse(contentDisposition, invocation));

versus the working example above:

response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\""); 

Notice the case on "disposition"

from http://www.ietf.org/rfc/rfc1806.txt we note:

   In the extended BNF notation of [RFC 822], the Content-Disposition
   header field is defined as follows:

        disposition := "Content-Disposition" ":"
                       disposition-type
                       *(";" disposition-parm)

Recommend changing the case to match the spec.


> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>             Fix For: 2.1.3
>
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Gabriel Cimoca (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44283#action_44283 ] 

Gabriel Cimoca commented on WW-2647:
------------------------------------

I can confirm the same issue in IE7. I checked the original source code and the following line is  missing:

//Clear any data that exists in the buffer as well as the status code and headers
oResponse.reset();

after this line

// Find the Response in context
HttpServletResponse oResponse = (HttpServletResponse) invocation.getInvocationContext().get(HTTP_RESPONSE);


> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>             Fix For: 2.1.3
>
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Ashish Sharma (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ashish Sharma reassigned WW-2647:
---------------------------------


Kindly update me on this issue, as we have some dependency on this.

Thanks

> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WW-2647) Result type stream issue with inline file download in IE6

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44227#action_44227 ] 

Dave Newton commented on WW-2647:
---------------------------------

I updated StreamResult to match the RFC (fancy that) but don't have IE6 to test until Monday, so if someone can confirm that it really does make a difference that'd be swell, otherwise I'll do it Monday (23 Jun).

> Result type stream issue with inline file download in IE6
> ---------------------------------------------------------
>
>                 Key: WW-2647
>                 URL: https://issues.apache.org/struts/browse/WW-2647
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5.17 as web server
> Using Eclipse 3.3 as IDE
>            Reporter: Ashish Sharma
>             Fix For: 2.1.3
>
>
> Hi,
>  I am using struts 2.0.11.
>  I am facing an issue in downloading pdf files as inline (open file in same browser window), in IE6.
>  Instead of opening the file in the browser window, pdf is opened separately and browser window remains open with nothing inside it. 
>  Following is the result defined for my action.
>  <result name="success" type="stream">
> 	<param name="contentDisposition">inline;filename="abc.pdf"</param> 
> 	<param name="contentType">application/pdf</param>
> 	<param name="inputName">reportStream</param>
> </result>
>  However this code seems to work fine for both IE7 and Firefox 2.0
>  Also this is not a browser issue with IE6, as i can open the pdf file in same window using the conventional approach below:
> HttpServletResponse response = ServletActionContext.getResponse();
> response.reset();
> response.setContentType("application/pdf");
> response.setContentLength(l_data.length);
> response.setBufferSize(l_data.length);
> response.setHeader("Content-Disposition", "inline; filename=\"abc.pdf\"");
> OutputStream out = response.getOutputStream();
> out.write(l_data);
> out.flush();
> response.flushBuffer();
>  Can you please look into this.
>  Thanks,
> Ashish

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.