New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 257250 link

Starred by 7 users

Issue metadata

Status: Fixed
Closed: Dec 2015
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

issue 68198

Sign in to add a comment

Content-Disposition header with a disposition of "inline" isn't used in a subsequent download.

Project Member Reported by, Jul 4 2013

Issue description

Version: 29.0.1547.0
OS: Android

Attached files downloaded from a local email service has names like view_submsg3.cgi which is a part of request URL, not the expected one such as "cert1.png".

The response header is as follows. Do we handle it correctly? Or is there anything missing/wrong in the header?

HTTP/1.1 200 OK
Date: Thu, 04 Jul 2013 03:53:03 GMT
Server: Apache
Content-Disposition: inline; filename="cert1.png"
Content-Length: 202322
Connection: close
Content-Type: application/download; name="cert1.png"

Just in case it might be useful, here's the request header too:

GET /Mail-bin/view_submsg3.cgi?TM=jOi5o%2BGuQ....=1&attid=0.1 HTTP/1.1
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.63 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: TS=1372909397; HTS=6kZiZnwWLnCZN_S5PeETJA00; HM_CU=4HEQbHEQb; PROF=.....7w0

Assigned to qinmin, since I saw a few similar issues already filed and assigned to him. Feel free to take it or reassign it. Thanks.

It's a missing feature; see <>

Note that the "name" parameter on Content-Type is irrelevant here.
Labels: M-X
Status: Assigned
Blocking: chromium:68198

Comment 4 by, Jul 18 2013

Summary: Content-Disposition header with a disposition of "inline" isn't used in a subsequent download. (was: Downloaded file has a wrong name)
julian.reschke: Recent desktop Chrome versions should behave as expected (i.e. use the filename for a download even if the disposition is 'inline'). Do you see the problem on desktop Chrome?

I'm unsure if my issue here is new, but it *seems* maybe to be related. If not and I need to open a new issue, I will.

Chrome appears to be ignoring the 'inline' content-disposition and forcing a download rather than opening the file inline (a PDF in my case).

Using Chrome Version 30.0.1599.101 m

Comment 6 by, Oct 29 2013

#5: Can we see the headers (both Content-Disposition and Content-Type)?
Project Member

Comment 7 by, Jan 28 2014

The following change refers to this bug:
Status: Started
Hi Shashi and Bo,

I'd like to address the remaining issue with file name from content disposition  header. Rather than reinventing the wheel, I'm thinking of making use of the well-tested to parse the header in native part and passing it across jni. In this way we can do away with incomplete parsing logic in Java. 

Can I have your input on this? If this sounds reasonable, let me make a cl and ask you to review it. Thanks.

Comment 9 by, Feb 7 2014


You are probably going to find upstreaming all the download code first will make refactoring a lot easier.
I would love to see this code upstreamed but it has a few downstream deps that would need to be resolved first (ChromeNotificationCenter and TabModelSelector). Also seems a bit orthogonal to the change in questoin

That sounds about right. Will try to go through some iterations to eventually upstreaming all the filename logic.
Project Member

Comment 13 by, Feb 8 2014

r249936 | | 2014-02-08T04:48:35.523986Z

Changed paths:

Pass the filename obtained from content-disposition header for download

This CL adds another parameter (filename) for Android to get correct
filename to download. Rather than parsing the header again in Java side,
already-implemented native header parser is used.

BUG= 257250 

Review URL:
jinsukkim: Could you mark this issue as fixed if it is?
Labels: Hotlist-Recharge
This issue likely requires triage.  The current issue owner maybe inactive (i.e. hasn't fixed an issue in the last 30 days).  Thanks for helping out!

Status: Fixed

Sign in to add a comment