New issue
Advanced search Search tips

Issue 733304 link

Starred by 5 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Downloading object created by createObjectURL results in 'download failed due to unknown error'

Reported by rien.kor...@gmail.com, Jun 14 2017

Issue description

Steps to reproduce the problem:
1. Open the minimal reproducer in the attached zip or http://plnkr.co/edit/5vFIm2
2. Click download
3. Observe the 'download failed due to unknown error' notification (see attached screenshot)
4. Go to downloaded files. Open file.
5. Observe that file was correctly downloaded.

What is the expected behavior?
The 'download failed due to unknown error' notification at #3 should not be observed.

What went wrong?
The 'download failed due to unknown error' notification at #3 was observed.

Did this work before? N/A 

Chrome version: 58.0.03029.83  Channel: stable
OS Version: 7.1.2
Flash Version: 

Also reported at:
 - https://github.com/eligrey/FileSaver.js/issues/330
 
Screenshot_20170614-182059.png
114 KB View Download
plunk-5vFIm2.zip
761 bytes Download
Removing save_link.download = "text.txt"; makes the problem go away but also results in opening the file rather downloading it.

Title should probably be updated to reflect that the download attribute is the cullprit.
Cc: dtrainor@chromium.org amineer@chromium.org
Components: UI>Browser>Downloads
Owner: qin...@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 3 by qin...@chromium.org, Jun 15 2017

Status: Fixed (was: Assigned)
This should have been fixed in M59, the issue is caused by adding the download to Android DownloadManager after download completion.
still seeing this issue in Android Chrome 59.0.3071.92 on Pixel with Android 7.1.2

Comment 5 by qin...@chromium.org, Jun 21 2017

hmm... wierd, i tried this and it worked fine for me.

Comment 6 by qin...@chromium.org, Jun 21 2017

I am using Chrome 59.0.3071.92 and Android 6.0

Comment 7 by qin...@chromium.org, Jun 21 2017

Sorry, the change fixes this issue doesn't make it into Chrome 59, but Chrome 60

Android 6.0 is not affected by this issue, only Android 7 has the issue.

Comment 8 by aa...@lockdrop.io, Aug 4 2017

With Android 7.0, Chrome 59.0.3071.125 as well as Chrome Beta 60.0.3112.78 on Google Nexus 6, I'm still seeing this issue.  (Chrome 60 doesn't seem to be available yet from the Google Play store?).

A workaround suggested https://github.com/eligrey/FileSaver.js/issues/330 to use a dataURI to save seems to work but only for tiny files.

Is the fix available in Chrome Beta, any plans to port it back to previous versions of Chrome?

Seems to be affecting many site that use Javascript to save files...
Tested on Chrome Beta 60.0.3112.72, Android 7.1.2, and i don't see the problem.

This should be available in Chrome Beta, as https://codereview.chromium.org/2876853007 fixed the problem

Comment 10 by aa...@lockdrop.io, Aug 6 2017

It appears to work in Chrome Beta for files that are < ~35MB (tested with 10, 20, 30, 35, 40).  Files larger seem to fail with the same error message "'download failed due to unknown error'".

Larger files however, do work on older versions of Android with older versions of Chrome (tested on Android 6 with Chrome 59.0.3071.125), does not work on Android 6 with Chrome Beta.  Does not work on Android 7 with Chrome 59.
interesting. does that happen for any data uri>35m? Do you have a link for repro?
Same issue with Chrome 61.0.3163.98 on Android 7.0
Data Uri(PDF) with a length of 11213184 fails with 'download failed due to unknown error'
Data Uri(PDF) with a length of 15288 is fine.
Data Uri(JPG) with a length of 6805643 is fine.

Chrome 62 on Windows open all uri(s) without any issues.

Status: Assigned (was: Fixed)
Reopen this bug to investigate the size issue
Cc: rbyers@chromium.org
Components: -Blink
There's definitely a limit to Data URIs - they're definitely not intended for large resources.  See, for example, https://stackoverflow.com/a/41755526/1102201

createObjectURL is the advice for large resources.  From https://github.com/eligrey/FileSaver.js/issues/330 it sounds like there's still a download issue for blob objects >30MB that's specific to Android.

I created a simple repro here: https://jsbin.com/cukayoy/edit?html,js,output and verified that it fails with the above error on Android Chrome 62.0.3202.52 but it seems to work fine on Chrome Android 63.0.3239.10 (and Windows Chrome 61).  Perhaps this has been fixed somehow in Chrome 63?  Regardless it seems likely this is specific to the Android downloads code, so removing 'Blink' label.

Cc: -amineer@chromium.org
No longer on the Chrome team, e-mail me @google.com if any attention still required from me here, otherwise good luck!

Sign in to add a comment