You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ./lib/private/Files/ObjectStore/S3.php, the method S3->writeObject() uses the putObject() method of the S3Client which only does single uploads. Instead, the upload() method should be used to automatically create multi part uploads if the file is larger than a certain threshold.
I replaced the function by the following code:
function writeObject($urn, $stream) {
$opts = array();
if (isset($this->params['upload_min_part_size'])) {
$opts['min_part_size'] = $this->params['upload_min_part_size'];
}
$this->getConnection()->upload($this->bucket, $urn, $stream, 'private', $opts);
}
The user can even set the parameter upload_min_part_size in the config.php to manually set the threshold (which has to be between 5 MB and 5 GB). Amazon recommends to consider multi part uploads for all files above 100 MB. But smaller might benefit, too because multi part uploads can happen using concurrent connections (The default of the aws code is up to 3 connections for normal files and doing multipart from 5 MB).
In the current development code on github, the writeObject method seems to have been moved into lib/private/Files/ObjectStore/S3ObjectTrait.php. I believe, the fix would still work though.
Steps to reproduce
Expected behaviour
Nextcloud should have obeyed Amazon's 5 GB limit on single transfer uploads and split the file into a multi part upload.
Actual behaviour
Nextcloud attempted to upload the file in a single transfer despite being larger than 5 GB.
Server configuration
Operating system:
Ubuntu
Web server:
Apache
Database:
MariaDB
PHP version:
7
Nextcloud version: (see Nextcloud admin page)
12.03
Updated from an older Nextcloud/ownCloud or fresh install:
fresh install
Where did you install Nextcloud from:
nextcloud.com
Signing status:
Signing status
No errors have been found.
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using encryption: yes/no
No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No
Nextcloud log (data/nextcloud.log)
Nextcloud log
The text was updated successfully, but these errors were encountered: