You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/06/07 17:17:48 UTC

DO NOT REPLY [Bug 39749] New: - Content-disposition filename is not working correctly

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39749

           Summary: Content-disposition filename is not working correctly
           Product: Apache httpd-2
           Version: 2.0.58
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: rbaily@servicebench.com
                CC: rbaily@servicebench.com


It appears that somewhere between 2.0.48 and 2.0.58 the setting of the Content-
Disposition to set the file name for content returned broke.  We are using 
Tomcat 5.0.28 and modJK 1.2.15.  I have put the example servlet code below.  
When you run the URL the browser pops up with the file name "TestServlet.doc" 
instead of "test_file_name.doc".  I don't believe this to be a Tomcat issue 
since it works with HTTP 2.0.48 and not with HTTP 2.0.58.

I ran http://dev.servicebench.com/rbaily/servlet/TestServlet on my system with 
this test servlet.

Please let me know if there is anything I can do to clarify or help.  Thanks!

/*
 * Created on Jun 7, 2006
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.servicebench.webside.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.*;

/**
 * @author rbaily
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class TestServlet extends HttpServlet {

	public void doGet(HttpServletRequest req, HttpServletResponse res)
	throws ServletException, IOException
	{
		doPost(req, res);
	}

	public void doPost(HttpServletRequest req, HttpServletResponse res)
	throws ServletException, IOException
	{
		res.setContentType( "application/msword" );
		res.setContentLength( 20 );
		// set up file name
		String fileName = "filename=\"test_file_name.doc\"";
System.out.println( "filename=" + fileName );				
		res.setHeader( "Content-Disposition", "attachment;" + 
fileName );
		res.setHeader( "Expires", "0" );
		res.setHeader( "Cache-Control", "must-revalidate, post-
check=0, pre-check=0" );
		ServletOutputStream output = res.getOutputStream();
System.out.println( "about to write" );				
		output.print( "012345678900987654321" );
		output.flush();
		output.close();
	}
	
}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39749] - Content-disposition filename is not working correctly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39749


rpluem@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From rpluem@apache.org  2006-06-08 19:28 -------
A similar application does work in my environment. Please provide the following
information:

- Browser you use. Especially please try with both IE and Firefox.
- Please capture the HTTP conversation either with a tool like livehttpheaders
for Firefox or provide a network sniff of the request and the response.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39749] - Content-disposition filename is not working correctly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39749





------- Additional Comments From rpluem@apache.org  2006-06-08 19:29 -------
Forgot one thing: Please provide a network sniff with 2.0.48 and one with a
later version >= 2.0.49 where it does not work as expected.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39749] - Content-disposition filename is not working correctly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39749





------- Additional Comments From rbaily@servicebench.com  2006-06-08 11:12 -------
It appears that this was introduced in 2.0.49.  This morning I built and 
installed 2.0.49 and had the same issue while using 2.0.48 does not.  I looked 
at the change list and didn't see anything obvious that looked related.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39749] - Content-disposition filename is not working correctly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39749





------- Additional Comments From rbaily@servicebench.com  2006-06-09 02:23 -------
Ok, thanks for the push in this direction.  I've done more research and seem 
to be at the root of the problem which looks like it was a combination of 
configuration mistake on my part and IE behavior.  I apologize now if I've 
wasted anyone's time.

Here are snapshots using tcpdump for 2.0.48 and 2.0.58.

Date: Fri, 09 Jun 2006 01:43:08 GMT
Server: Apache/2.0.58 (Unix) mod_ssl/2.0.58 OpenSSL/0.9.7d mod_jk/1.2.15
Content-Disposition: attachment;filename="test_file_name.xls"
Expires: 0
Cache-Control: must-revalidate, post-check=0, pre-check=0
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/vnd.ms-excel

a
..........

21:38:10.448716 IP devbox2.servicebench.com.http > 
cheetah.servicebench.com.2156: P 1:421(420) ack 455 win 6432
E....)@.@.x[
..w
../.P.l...i=...P.. ....HTTP/1.1 200 OK
Date: Fri, 09 Jun 2006 01:38:10 GMT
Server: Apache/2.0.48 (Unix) mod_ssl/2.0.48 OpenSSL/0.9.7d mod_jk/1.2.15
Content-Disposition: attachment;filename="test_file_name.xls"
Expires: 0
Cache-Control: must-revalidate, post-check=0, pre-check=0
Content-Length: 20
Vary: User-Agent
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: application/vnd.ms-excel

0
12345678900987654321

I have the mod_deflate module active.  So what happened is that our 
configuration had the regex in there for IE (BrowserMatch \bMSIE !no-gzip !
gzip-only-text/html) which according to some other text did not work due to a 
bug in mod_setenvif up to 2.0.48.  So as you can see from the captures the 
content was not being compressed in 2.0.48 but was in any version after due to 
the mod_setenvif fix.  I did find that this does work for Firefox even with 
the compression.  So it appears that there is an ongoing issue with the way 
that IE handles the content-disposition when the result is compressed.

So I don't know if there is a good way to document this for future reference 
for other.  I'll see if I can do anything to start the Micorsoft machine in 
motion if that is even possible.  Again, sorry if this wasted anyone's time.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39749] - Content-disposition filename is not working correctly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39749





------- Additional Comments From trawick@apache.org  2006-06-08 16:48 -------
I looked through 2.0.48->2.0.49 changes and am stumped.

I suggest you discuss with the Tomcat folks which web server behavior inflences
the generation of that header field.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39749] - Content-disposition filename is not working correctly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39749





------- Additional Comments From rbaily@servicebench.com  2006-06-19 13:28 -------
I have been unable to find any Microsoft realted information on this at the 
present time.  Sorry.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39749] - Content-disposition filename is not working correctly

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39749>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39749


rpluem@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |INVALID




------- Additional Comments From rpluem@apache.org  2006-06-09 15:10 -------
Thanks for feedback. So I mark the report as invalid. I currently have no good
idea where to place this information, but it would be very kind of you if you
could add any further information regarding this problem just to this report. So
once we have found a good place to store this information we can take it from
here and it does not get lost. Furthermore other users can search bugzilla by
its own search capabilities or via a search engine such they possibly get this
information.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org