Skip to content

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Nov 3, 2017

Imported from owncloud/core#28415.

This pull request adds chunked uploads in the Web UI (for authenticated users, but not for public uploads). To do that the server endpoint used by the uploader is changed from WebDAV v1 to WebDAV v2. The chunking itself is done automatically by the jQuery-File-Upload plugin when the maxChunkSize parameter is set; in fileuploadchunksend the request is adjusted to adapt the behaviour of the plugin to the one expected by uploads/ in WebDAV v2.

The chunk size to be used by the Web UI can be set in the max_chunk_size parameter of the Files app configuration. By default it is set to 10MiB.

Differences with the original pull request:

  • port is not removed; removing it is not needed for the other changes (it was just an unrelated cleanup due to the port being already included in host), and it could be needed by some user of the client object, so it feels safer to keep it.
  • core/js/config.php was removed in Remove config.php for oc.js #1961 after its functionality was replaced with lib/private/Template/JSConfigHelper.php; the changes are not needed in the new code.
  • apps/files/lib/App.php was adapted due to the settings array now (after the configuration changes mentioned above) being encoded in JSON instead of being a plain PHP array.

This pull request (like the original one, if I am not mistaken) is not bug free. If an upload is cancelled it is not possible to upload other files until the page is reloaded, and there are also some issues with the progress bar when several files are uploaded at once and one of them fails.

However, I would prefer to merge this as is now and fix the bugs later to be able to import other pull requests based on this one in an easier way.

This commit adds chunked uploads in the Web UI (for authenticated users,
but not for public uploads). To do that the server endpoint used by the
uploader is changed from WebDAV v1 to WebDAV v2. The chunking itself is
done automatically by the jQuery-File-Upload plugin when the
"maxChunkSize" parameter is set; in "fileuploadchunksend" the request is
adjusted to adapt the behaviour of the plugin to the one expected by
"uploads/" in WebDAV v2.

The chunk size to be used by the Web UI can be set in the
"max_chunk_size" parameter of the Files app configuration. By default it
is set to 10MiB.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@danxuliu danxuliu force-pushed the oc-28415-enable-chunking-in-authenticated-web-upload branch from 5d3b31c to cd8d13b Compare November 3, 2017 16:19
@codecov
Copy link

codecov bot commented Nov 3, 2017

Codecov Report

Merging #7056 into master will decrease coverage by <.01%.
The diff coverage is 45.45%.

@@             Coverage Diff              @@
##             master    #7056      +/-   ##
============================================
- Coverage     50.61%   50.61%   -0.01%     
- Complexity    24297    24298       +1     
============================================
  Files          1577     1577              
  Lines         92922    92931       +9     
  Branches       1359     1359              
============================================
+ Hits          47036    47040       +4     
- Misses        45886    45891       +5
Impacted Files Coverage Δ Complexity Δ
apps/files/appinfo/app.php 100% <ø> (ø) 0 <0> (ø) ⬇️
apps/files/lib/App.php 17.64% <0%> (-9.63%) 3 <1> (+1)
core/js/files/client.js 83.02% <100%> (+0.15%) 0 <0> (ø) ⬇️
apps/files_trashbin/lib/Trashbin.php 72.53% <0%> (+0.24%) 136% <0%> (ø) ⬇️

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works +1

@blizzz blizzz merged commit 1a2f9fe into master Nov 10, 2017
@blizzz blizzz deleted the oc-28415-enable-chunking-in-authenticated-web-upload branch November 10, 2017 14:36
MorrisJobke pushed a commit to nextcloud/documentation that referenced this pull request Nov 10, 2020
documenting nextcloud/server#7056

Signed-off-by: Sascha Wiswedel <[email protected]>
MorrisJobke pushed a commit to nextcloud/documentation that referenced this pull request Nov 10, 2020
documenting nextcloud/server#7056

Signed-off-by: Sascha Wiswedel <[email protected]>
MorrisJobke pushed a commit to nextcloud/documentation that referenced this pull request Nov 10, 2020
documenting nextcloud/server#7056

Signed-off-by: Sascha Wiswedel <[email protected]>
MorrisJobke pushed a commit to nextcloud/documentation that referenced this pull request Nov 10, 2020
documenting nextcloud/server#7056

Signed-off-by: Sascha Wiswedel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants