Problem/Motivation
In Drupal, all uploads posting via Ajax ($.ajaxSubmit). $.ajaxSubmit is posting FULL FORM DATA all time. Therefore when you uploading files simultaneously, the seconds and later uploads always re-upload previous file data.
In my testing, I trying to upload 2 files (20MB & 30MB). Here's the Content-Length for each posting:
FIRST INPUT:
Content-Length: 31647757
SECOND INPUT:
Content-Length: 53387537
Steps to reproduce:
1. Find a slow server / Or throttling via Proxy or Chrome Console / Or find a timer
2. Setup 2 file uploads
3. Starting to upload a large file to INPUT 1
4. During INPUT 1 is uploading, starting to upload another large file to INPUT 2
5. Check posting data length / upload time
(Noted that: You shouldn't trust Chrome Console throttling all time, in some cases won't work well.)
Proposed resolution
There is code to make an upload button disable file fields for other upload buttons, but it checks to see if the upload button use the Drupal AJAX API, even though the file upload buttons do not use that API. It is fixed by removing this check.
Comment | File | Size | Author |
---|---|---|---|
#10 | simultaneous-file-uploads-2666746-10.patch | 1.61 KB | Darren Oh |
Comments
Comment #2
droplet CreditAttribution: droplet commentedComment #3
droplet CreditAttribution: droplet commentedComment #4
droplet CreditAttribution: droplet commentedComment #10
Darren OhThis bug is caused by the JavaScript only processing buttons that use the Drupal AJAX API even though the file upload buttons do not use this API.
Comment #11
Darren OhComment #12
3CWebDev CreditAttribution: 3CWebDev commentedReviewed patch on 8.5/8.6 to verify that previous file data is no longer submitted with subsequent file uploads. Patch works as expected to fix reported bug.
Comment #13
gbirch CreditAttribution: gbirch at Tech-Tamer, LLC, Commonwealth of Massachusetts commentedIs this the same as issue https://www.drupal.org/project/drupal/issues/2884052 ?
Comment #14
Darren OhNo, that is a different issue.
Comment #17
catchCommitted/pushed to 8.6.x and cherry-picked to 8.5.x, thanks!