Re: Issue 104331 in chromium: Can't download a .pdf file served as binary/octet-stream

1,082 views
Skip to first unread message

chro...@googlecode.com

unread,
Apr 4, 2012, 3:10:53 PM4/4/12
to chromi...@chromium.org
Updates:
Summary: Can't download a .pdf file served as binary/octet-stream

Comment #35 on issue 104331 by rds...@chromium.org: Can't download a .pdf
file served as binary/octet-stream
http://code.google.com/p/chromium/issues/detail?id=104331

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Apr 4, 2012, 3:14:56 PM4/4/12
to chromi...@chromium.org

Comment #36 on issue 104331 by rds...@chromium.org: Can't download a .pdf

Issue 121125 has been merged into this issue.

chro...@googlecode.com

unread,
Apr 24, 2012, 5:03:40 AM4/24/12
to chromi...@chromium.org

Comment #37 on issue 104331 by d...@chromium.org: Can't download a .pdf file

Issue 124775 has been merged into this issue.

chro...@googlecode.com

unread,
Apr 24, 2012, 5:08:40 AM4/24/12
to chromi...@chromium.org
Updates:
Labels: -Area-UI Area-Internals Internals-Network

Comment #38 on issue 104331 by d...@chromium.org: Can't download a .pdf file

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Apr 24, 2012, 4:20:41 PM4/24/12
to chromi...@chromium.org

Comment #39 on issue 104331 by balrogth...@gmail.com: Can't download a .pdf

This same issue appears to be happening for me with a PHP-generated CSV
file, but only if I use Content-Disposition: attachment; if I leave that
off, the file opens correctly in a new tab, but I want it to download. I
have tried Content-types text/csv, Document, and
application/force-download, all with no effect: the download is cancelled
even though the header status is 200 in the Network tab. I've had other
people in my office try, and both a Windows 7 and Mac user were able to
download the file with no problems.

Chrome version: 18.0.1025.162 m

chro...@googlecode.com

unread,
May 2, 2012, 12:05:13 PM5/2/12
to chromi...@chromium.org

Comment #41 on issue 104331 by brauc...@gmail.com: Can't download a .pdf
I have the same problem with version 18.0.1025.168 on Linux when
downloading PDFs from a SVN-HTTP respository. The content type there seems
to be: "application/octet-stream" and Apache(2.2) or mod_dav_svn logs:
---
Unable to deliver content. [500, #0]
(104)Connection reset by peer: Could not write data to filter. [500, #0]
---

chro...@googlecode.com

unread,
Aug 3, 2012, 1:52:33 PM8/3/12
to chromi...@chromium.org
Updates:
Cc: rds...@chromium.org

Comment #45 on issue 104331 by rva...@chromium.org: Can't download a .pdf
Issue 132580 has been merged into this issue.

chro...@googlecode.com

unread,
Aug 6, 2012, 6:07:33 PM8/6/12
to chromi...@chromium.org

Comment #46 on issue 104331 by rds...@chromium.org: Can't download a .pdf
@balrogthane: That doesn't sound like this problem; at least, if you don't
have a plugin registered for .csv files, it's not this problem. Could you
visit "about:plugins" in your browser, scan for .csv, and if .csv isn't
anywhere on that page, file a new bug?


chro...@googlecode.com

unread,
Aug 23, 2012, 11:30:18 PM8/23/12
to chromi...@chromium.org
Updates:
Labels: -Mstone-22 Mstone-23

Comment #48 on issue 104331 by asa...@chromium.org: Can't download a .pdf
Moved to M23.

The issue is still there. The Chrome side policy decision takes a few more
factors into account than the WebKit side policy decision. E.g. the Chrome
side decision takes the result of PluginServiceFilter into account, which
WebKit does not.


chro...@googlecode.com

unread,
Sep 11, 2012, 3:16:05 PM9/11/12
to chromi...@chromium.org
Updates:
Cc: asa...@chromium.org

Comment #49 on issue 104331 by asa...@chromium.org: Can't download a .pdf
Issue 133107 has been merged into this issue.

chro...@googlecode.com

unread,
Sep 13, 2012, 9:50:37 AM9/13/12
to chromi...@chromium.org

Comment #50 on issue 104331 by pauljen...@chromium.org: Can't download
a .pdf file served as binary/octet-stream
http://code.google.com/p/chromium/issues/detail?id=104331

I spent some time investigating this. One solution would be to have WebKit
notify the browser process when it's unable to render for lack of MIME type
support. This could be done by sending an IPC message from
RenderViewImpl::didFailResourceLoad...however by this time WebKit has
already sent a ResourceHostMsg_CancelRequest message. If you take a look
at WebCore::ResourceLoader::cancel(const ResourceError& error) you can see
how |error| is only passed to didFailToLoad (which calls
RenderViewImpl::didFailResourceLoad) *after* m_handle->cancel() is called.
Asanka also noted that didFailToLoad is not always called after
m_handle->cancel() so the browser process cannot wait for the message from
didFailToLoad assuming [wrongly] that it always arrives after the cancel
message. It would be most convenient if, in the browser process, we knew
before canceling a resource request that it wouldn't be rendered and
instead we should just download the resource.

chro...@googlecode.com

unread,
Sep 13, 2012, 12:55:54 PM9/13/12
to chromi...@chromium.org
Updates:
Owner: pauljen...@chromium.org

Comment #51 on issue 104331 by asa...@chromium.org: Can't download a .pdf
Paul is looking into this.

chro...@googlecode.com

unread,
Sep 21, 2012, 11:37:46 AM9/21/12
to chromi...@chromium.org
Updates:
Labels: -Mstone-23 Mstone-24

Comment #52 on issue 104331 by rds...@chromium.org: Can't download a .pdf

chro...@googlecode.com

unread,
Oct 17, 2012, 4:45:08 PM10/17/12
to chromi...@chromium.org

Comment #53 on issue 104331 by rds...@chromium.org: Can't download a .pdf
Issue 156375 has been merged into this issue.

chro...@googlecode.com

unread,
Nov 7, 2012, 9:47:37 PM11/7/12
to chromi...@chromium.org

Comment #57 on issue 104331 by bsama...@gmail.com: Can't download a .pdf
My csv export isn't getting prompted to save/download, it's rendered on the
screen.

B

chro...@googlecode.com

unread,
Nov 8, 2012, 11:20:10 AM11/8/12
to chromi...@chromium.org

Comment #58 on issue 104331 by asa...@chromium.org: Can't download a .pdf
bsamayoa: See issue 152911

chro...@googlecode.com

unread,
Nov 29, 2012, 3:32:44 AM11/29/12
to chromi...@chromium.org

Comment #59 on issue 104331 by m...@davidfrancos.net: Can't download a .pdf
I've seen that same problem downloading an xls file with an <a href> and
this response headers:
Cache-Control:max-age=0
Connection:Keep-Alive
Content-Disposition:attachment; filename="foo.xls"
Content-Length:6144
Content-Type:application/octet-stream
Date:Thu, 29 Nov 2012 08:23:24 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive:timeout=5, max=98
Pragma:public
Server:Apache/2.2.22 (Debian)
X-Powered-By:PHP/5.4.4-9

I workarounded it by adding a target to it, if it helps someone ;-)

chro...@googlecode.com

unread,
Nov 29, 2012, 2:19:12 PM11/29/12
to chromi...@chromium.org

Comment #60 on issue 104331 by rds...@chromium.org: Can't download a .pdf
@me: Just confirming that the behavior you're seeing is that when you click
on the .xls file link nothing happens (i.e. you don't see a download and
you don't see it displayed in the browser)? That surprises me, as AFAIK we
don't have a plugin that displays excel spreadsheets, which is what's
producing the problem for .pdf.


chro...@googlecode.com

unread,
Nov 29, 2012, 2:44:30 PM11/29/12
to chromi...@chromium.org

Comment #61 on issue 104331 by bjf2...@gmail.com: Can't download a .pdf
Plugins are N/A to the issue as far as I've seen. One of the previous
reports merged into this one:
http://code.google.com/p/chromium/issues/detail?id=132580

I really can't believe this issue is still around.

chro...@googlecode.com

unread,
Nov 29, 2012, 3:13:15 PM11/29/12
to chromi...@chromium.org
Updates:
Status: Available
Owner: ---

Comment #62 on issue 104331 by asa...@chromium.org: Can't download a .pdf
I'm not going to be able to get to this anytime soon.


chro...@googlecode.com

unread,
Nov 29, 2012, 4:13:47 PM11/29/12
to chromi...@chromium.org

Comment #63 on issue 104331 by mjlar...@gmail.com: Can't download a .pdf
Yeah, it's been over a year, I just tell people to use a different browser.

chro...@googlecode.com

unread,
Dec 9, 2012, 1:03:26 PM12/9/12
to chromi...@chromium.org
Updates:
Status: Untriaged

Comment #64 on issue 104331 by rds...@chromium.org: Can't download a .pdf
Switching to Untriaged to get into the next triage round.

chro...@googlecode.com

unread,
Dec 17, 2012, 1:54:30 PM12/17/12
to chromi...@chromium.org
Updates:
Labels: -Internals-Network

Comment #65 on issue 104331 by ke...@google.com: Can't download a .pdf file
Taking internals-network off so download folks only get this.

chro...@googlecode.com

unread,
Dec 31, 2012, 10:24:31 PM12/31/12
to chromi...@chromium.org

Comment #66 on issue 104331 by jnan...@gmail.com: Can't download a .pdf
uh... any movement on this?

chro...@googlecode.com

unread,
Jan 18, 2013, 10:39:17 AM1/18/13
to chromi...@chromium.org

Comment #68 on issue 104331 by leif.sta...@caseware.com: Can't download
a .pdf file served as binary/octet-stream
http://code.google.com/p/chromium/issues/detail?id=104331

Not only does chrome cancel the request, it displays any requests made to
the same server at the same time as cancelled.

Attachments:
chrome bug.PNG 12.1 KB

chro...@googlecode.com

unread,
Mar 3, 2013, 6:12:38 PM3/3/13
to chromi...@chromium.org

Comment #70 on issue 104331 by lembi2...@gmail.com: Can't download a .pdf
Seriously, this is beyond a joke now. This issue has been hanging around
for over a year now.

It is happening to me on exe files. The latest one is even on a Google
Site. (see attachment)

System Details

OS: Windows 7 Professional SP1
Chrome: Version 25.0.1364.97 m

Surely there must be a fix for this by now. It is a little infuriating.

Attachments:
chrome error.png 160 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Mar 15, 2013, 12:30:24 PM3/15/13
to chromi...@chromium.org

Comment #72 on issue 104331 by rapal...@gmail.com: Can't download a .pdf
Same here, im having an error generated when downloading reports in CSV,
TXT, and XLS/XLSX format.

Im using the following headers(Kohana 3.0.8):
$this->request->headers['Content-type']
= 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';

$this->request->headers['Content-disposition'] = 'attachment;
filename="'.$report_name.'.xlsx"';

Chrome cancels the download, sometimes the files download, sometimes they
dont. Its frustrating since it gives a sense of instability to the feature
when programmatically the files are being generated and sent as they should.

error in console:

Resource interpreted as Document but transferred with MIME type
application/csv.



Attachments:
chrome bug.tiff 56.8 KB

chro...@googlecode.com

unread,
Apr 12, 2013, 5:07:44 PM4/12/13
to chromi...@chromium.org

Comment #74 on issue 104331 by pmcca...@rarewire.com: Can't download a .pdf
Is there a combination of headers that reliably works around this problem,
preferably without breaking download behavior in other browsers?

I see a couple of solutions upthread for very specific circumstances, but
no "here's what to do to get plain ol' application/octet-stream downloads
to work 100% of the time". Apologies if it's there and I've overlooked it.

chro...@googlecode.com

unread,
Apr 15, 2013, 3:10:12 PM4/15/13
to chromi...@chromium.org

Comment #75 on issue 104331 by w3midi...@gmail.com: Can't download a .pdf
I'v found a fix, workaround to force download with the attribute "download".
Try <a href="teste.pdf" download="teste.pdf"></a>
Tested on version: 26.0.1410.64 m

chro...@googlecode.com

unread,
Apr 15, 2013, 3:14:12 PM4/15/13
to chromi...@chromium.org

Comment #76 on issue 104331 by evandrom...@gmail.com: Can't download a .pdf

chro...@googlecode.com

unread,
Apr 29, 2013, 3:57:38 PM4/29/13
to chromi...@chromium.org

Comment #80 on issue 104331 by asa...@chromium.org: Can't download a .pdf
Issue 233927 has been merged into this issue.

chro...@googlecode.com

unread,
May 7, 2013, 11:39:18 AM5/7/13
to chromi...@chromium.org

Comment #82 on issue 104331 by dengruil...@gmail.com: Can't download a .pdf
I meet with same issue when download excel in my site. Anyone have the
solution for chrome now?

chro...@googlecode.com

unread,
May 9, 2013, 6:34:39 PM5/9/13
to chromi...@chromium.org

Comment #84 on issue 104331 by nherr...@google.com: Can't download a .pdf
I am seeing a similar issue for a regular, correctly-mime-typed (video/mp4)
download from Google Cloud Storage on Mobile Chrome for Android. It
switches to the player view and then fails to play. Is this separate
because it's not the download manager, or the same because the download
manager is intercepting it and letting it fall on the floor?

I'm having difficulty figuring out how to attach a network trace from
Mobile Chrome to corroborate.

chro...@googlecode.com

unread,
May 9, 2013, 7:10:39 PM5/9/13
to chromi...@chromium.org
Updates:
Cc: -asa...@chromium.org

Comment #85 on issue 104331 by asa...@chromium.org: Can't download a .pdf
#84: If the MIME type wasn't application/octet-stream, then you aren't
seeing this issue.

chro...@googlecode.com

unread,
Jun 6, 2013, 1:05:20 PM6/6/13
to chromi...@chromium.org

Comment #86 on issue 104331 by ramdas....@gmail.com: Can't download a .pdf
Seeing the same issue
AddType application/octet-stream .pdf .mp3 .zip in the .htaccess

Chrome will not download any files covered by application/octet-stream,
only workaround is #77, #78 does not appear to work.

chro...@googlecode.com

unread,
Jun 27, 2013, 10:43:01 PM6/27/13
to chromi...@chromium.org

Comment #87 on issue 104331 by johnno...@gmail.com: Can't download a .pdf
Same issue with my Joomla site. Tried everything above, did a bit more
searching then added this to the .htaccess. Make sure you clear your
browser cache.

<FilesMatch "\.(?i:pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>

chro...@googlecode.com

unread,
Jul 1, 2013, 7:26:34 AM7/1/13
to chromi...@chromium.org

Comment #88 on issue 104331 by and...@basechat.com: Can't download a .pdf
Just for the record: I had this problem, but it seems to me that Chrome is
just more picky, than IE and Firefox, regaring the syntaxs af the
Content-Disposition.

E.g. by mistake I had "Content-Disposition:" instead
of "Content-Disposition" and it this cuased Chrome to cancel.

Duble pling around the filename may be requried to for Chrome, but not in
other browsers.

chro...@googlecode.com

unread,
Jul 1, 2013, 1:51:40 PM7/1/13
to chromi...@chromium.org

Comment #89 on issue 104331 by ramdas....@gmail.com: Can't download a .pdf
#87 works as expected, fantastic! Thanks.

chro...@googlecode.com

unread,
Jul 8, 2013, 9:50:49 AM7/8/13
to chromi...@chromium.org

Comment #90 on issue 104331 by say...@gmail.com: Can't download a .pdf file
Same issue. After disabling "Chrome PDF Viewer" plugin everything works as
expected.

chro...@googlecode.com

unread,
Aug 27, 2013, 1:02:55 PM8/27/13
to chromi...@chromium.org

Comment #94 on issue 104331 by rquez...@copec.cl: Can't download a .pdf
I have the same issue with the latest version (29.0.1547.62 m) when i try
to export a .xls file

chro...@googlecode.com

unread,
Aug 27, 2013, 2:27:56 PM8/27/13
to chromi...@chromium.org
Updates:
Labels: Restrict-AddIssueComment-EditIssue

Comment #95 on issue 104331 by asa...@chromium.org: Can't download a .pdf
The fix will be available starting with Chrome/Chromium 30.x. Please open a
new issue if you are seeing similar issues with versions of Chrome 30 or
above.

The supported means of indicating that a resource must be downloaded is to
use the Content-Disposition header field
(http://tools.ietf.org/html/rfc6266).
Reply all
Reply to author
Forward
0 new messages