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

- Removing the UPLOADING INPUT temporarily
(I've attached a patch to demo how it's possible. However in my patch that doesn't handle any network failing.)

- (Or.. removing the form data before calling $.ajaxSubmit.)

Remaining tasks

- Needs a Patch

User interface changes

- TBA

API changes

- TBA

Data model changes

- TBA

Files: 
CommentFileSizeAuthor
#3 file-upload-bug-2666746-do-not-test.patch539 bytesdroplet

Comments

droplet created an issue. See original summary.

droplet’s picture

Issue tags: +JavaScript
droplet’s picture

Title: Investigate whether simultanous uploads posting data repeatly » [PERFORMANCE] Simultaneous file uploads re-posting data
Issue summary: View changes
Priority: Normal » Major
Issue tags: +Performance, +FileField, +Field system
FileSize
539 bytes
droplet’s picture

Issue summary: View changes

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.