New issue
Advanced search Search tips

Issue 822542 link

Starred by 10 users

Issue metadata

Status: Duplicate
Merged: issue 828963
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Multiple files download is not working in Chrome Version 65.0.3325.162(Official Build)(32 bit)

Reported by workingt...@gmail.com, Mar 16 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36

Example URL:
https://stackoverflow.com/questions/2339440/download-multiple-files-with-a-single-action

Steps to reproduce the problem:
Reproduce steps:
================
1. Enter the following 'Test url' in the Chrome browser Version 65.0.3325.162(Official Build)(32 bit)

Test url: https://stackoverflow.com/questions/2339440/download-multiple-files-with-a-single-action
2. If pop up screen appears stating "Download multiple files", select "Allow"

3. Check the (Browser) Settings --> Advanced --> Content settings --> Automatic download for "https://s3.amazonaws.com" 

4. If not found you can add manually pressing Add button.

5. Go to 'Test url' tab and click button,"Run code snippet" and then click button, "Test Me!"

6. Notice: Check for the downloaded files.

Problem: 
========
Only one file "Minecraft.jar" is downloaded. (the last file) 

What is the expected behavior?
Expectation:
============
All of the three files needs to be downloaded.

The code snippent has following three links for downloading,
  'https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.exe',  'https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.dmg',  'https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar'

What went wrong?
Observation:
=============
We have implemented ag-Grid API to download multiple files in our web application.

We have used the following ag-Grid API to download multiple CSV files
   gridOps.api.exportDataAsCsv(params);

Findings: Same problem found as only single file gets downloaded

Please check following url for detail,
https://www.ag-grid.com/javascript-grid-export/

Does it occur on multiple sites: Yes

Is it a problem with a plugin? N/A 

Did this work before? Yes Windows OS: Chrome Version 64.0.3282.186 and Mac OS: Chrome Version 13.3.0 

Does this work in other browsers? Yes

Chrome version: 65.0.3325.162  Channel: stable
OS Version: 10.0
Flash Version:
 
1_Multiple_files_download_issue.PNG
166 KB View Download
2_Multiple_files_download_settings.PNG
70.2 KB View Download
3_Chrome_version.PNG
77.0 KB View Download

Comment 1 by gov...@chromium.org, Mar 16 2018

Labels: Needs-Triage-M65

Comment 2 by woxxom@gmail.com, Mar 16 2018

Bisect info: 526470 (good) - 526476 (bad)
https://chromium.googlesource.com/chromium/src/+log/c6e321c6..eadeea9d?pretty=fuller
Suspecting r526475 = f2d2fe87028de36a489f7db3f5fb28da2e9d9b2b = https://crrev.com/c/758236 by jochen@chromium.org
"Use navigation for <a download>"
Landed in 65.0.3310.0

Comment 3 by gov...@chromium.org, Mar 16 2018

Cc: pbomm...@chromium.org jochen@chromium.org

Probably a dupe of  bug  821219  per bisect listed at #2.

Comment 4 by gov...@chromium.org, Mar 16 2018

Cc: -jochen@chromium.org
Owner: jochen@chromium.org
Status: Assigned (was: Unconfirmed)

Comment 5 by gov...@chromium.org, Mar 16 2018

Cc: gov...@chromium.org

Comment 6 by jochen@chromium.org, Mar 16 2018

Status: WontFix (was: Assigned)
this is intended behavior. Note that Firefox behaves the same.

Comment 7 by woxxom@gmail.com, Mar 16 2018

Was there a specification update that forbids multiple download of files?

Comment 8 by jochen@chromium.org, Mar 16 2018

for better or worse, the specification doesn't say anything about that, but unifying the behavior of browsers is a step into the direction of getting a spec.

Comment 9 by woxxom@gmail.com, Mar 16 2018

Does this mean the "automatic downloads" setting will be removed from chrome://settings/content/automaticDownloads ?
Or is that different?
that's a good question. I still manage to trigger the dialog, so I guess for the time being, we'll keep it
Thanks and even FireFox behaves the sames but Chrome is more reliable as we think.  The problem is each download does not have a setTimer for multiple download in current implementation. Can this be fixed in Chrome if you decide to have Automatic download?
have you considered creating a zip archive if you want to serve multiple files at once? That would work reliably in all browsers..
Yes but for our use case, downloading multiple files requirement is set this way to have the separate files downloaded. This feature used to work before also. So, if this issue is fixed, it will not be related to zip archive and will make Chrome better. 
 Issue 823841  has been merged into this issue.
Please take back this feature since our app also relies on this "download multiple files" function, this sudden change in Chrome 65 will cause a lot of inconvenience to our users.

I'm not sure why you are removing this feature since this is inconsistent with the "Automatic Download" settings. It doesn't make sense to me also that Chrome doesn't support this because FireFox doesn't too, the removal of this feature only affects those sites where they suppose to download multiple files, making them only download single file doesn't benefit those scenarios which only needs download single file. In addition, Firefox only has ~13% market share while Chrome has ~60%, due to the reliability, stability, and performance of Chrome, this injudicious change absolutely harms those virtues of Chrome. 

I know the "Zip archive" solution might be a better fix for this. But it requires a lot of change in our backend server, which can't be accomplished in a couple of days. So it would be great if you could take back and keep this feature for the next couple of Chrome releases.


Comment 16 by woxxom@gmail.com, Mar 21 2018

FWIW, one possible workaround is to create a temporary iframe for each URL.
I've modified the example from StackOverflow link in #0 so it works in Canary 67.

<body>

  <button onclick="downloadAll(window.links)">Test me!</button>

  <script>
  var links = [
    'https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.exe',
    'https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.dmg',
    'https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar'
  ];

  function downloadAll(urls) {
    urls.forEach(url => {
      const iframe = document.createElement('iframe');
      iframe.style.setProperty('display', 'none', 'important');
      iframe.sandbox = 'allow-modals allow-scripts';
      iframe.onload = () => {
        setTimeout(() => iframe.remove());
      };
      iframe.srcdoc = `<body><script>{
        const link = document.body.appendChild(document.createElement('a'));
        link.download = '';
        link.href = JSON.parse('${JSON.stringify(url)}');
        link.dispatchEvent(new MouseEvent('click'));
      }<${'/'}script></body>`;
      document.body.appendChild(iframe);
    });
  }
  </script>
</body>

That was just a quick hack at the problem so maybe it can be simplified/improved.
For such a general issue, I still think this fix is possible at Chrome implementation considering the work around that we can do but this is a feature also.

  
Woxxom,

Thanks for sharing that workaround.

I tried it and for most cases, it works as intended. But when I tried to download .pdf files, it has an error and won't download the file. I guess this is another change in v65, that even I use <a> tag with "download=xxx.pdf" attribute set, Chrome still opens it instead of downloading it, this is different with v64.
if the URL is cross origin, the server didn't reply with a content disposition header, and chrome can render the mime type, it'll render the file.
jochen,

Thanks for the explanation. It seems like the "download" attribute in the <a> tag doesn't affect anything now. 

Also, click on a single <a> tag with target="_blank" attribute, Chrome directly blocks it, you need to click the unnoticeable icon on the right of omnibox to allow it for the first time. While this is allowed in v64 by default.
I don't agree with the fact that this change is to align with FireFox behaviour. The same multiple file download works in firefox for me. Also, In our APP , we allow user to download as single file / multiple files. Its about user experience. Its not nice to remove an important feature just because firefox doesnt support. Lot of users use chrome for lack of features in Firefox
Issue 826722 has been merged into this issue.
I agree with couple other comments above that, this feature should not have been changed.

In our corporation, we have also a system where downloading a multiple files at once is a handy and intentionally developed feature from respect of end-user point of view. By disabling this possibility, handling multiple files came inconvenient and it forces us to use IE instead, which in-turn behaves inconveniently in other means.

And this change is in collision with the automatic downloads content setting.
We use multiple downloads to generate multiple CSV files, which are needed for different transportation companies. downloading a ZIP archive would make it a unneeded pain ...
The solution, to let the user decide, if he wants to accept multiple download for a page was the right way to doo it. changing it now, to make it more easy/simple, makes it more complicated!
Cc: rbyers@chromium.org
Mergedinto: 828963
Status: Duplicate (was: WontFix)
Sorry for the pain this has caused everyone!

FWIW jochen@ relaxed our behavior in  issue 828963  to better match what Firefox is doing, and this has now shipped to stable in Chrome 66.  If anyone is still having a problem that works in Firefox but fails in Chrome, please mention it here.

Sign in to add a comment