diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-01-29 11:14:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-29 11:14:05 +0100 |
commit | 0fd208a83bdeae986234ed3c5485f78ff2229ab2 (patch) | |
tree | a8236c5f06aa630a802cc3b3cf1211c30b435f39 /lib | |
parent | 2682d672d8076302da61fef3cc15e4d647d50be5 (diff) | |
parent | 1d322d3b375ff2e93c17e79efa619a20ec809f3d (diff) | |
download | nextcloud-server-0fd208a83bdeae986234ed3c5485f78ff2229ab2.tar.gz nextcloud-server-0fd208a83bdeae986234ed3c5485f78ff2229ab2.zip |
Merge pull request #13866 from nextcloud/s3-multipart-uploader
always use multipart uploader for s3 uploads
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/ObjectStore/S3ObjectTrait.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index a1110d87c8f..0b55c319ea8 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -23,6 +23,7 @@ namespace OC\Files\ObjectStore; +use Aws\S3\MultipartUploader; use Aws\S3\S3Client; const S3_UPLOAD_PART_SIZE = 524288000; // 500MB @@ -72,10 +73,12 @@ trait S3ObjectTrait { * @since 7.0.0 */ function writeObject($urn, $stream) { - $this->getConnection()->upload($this->bucket, $urn, $stream, 'private', [ - 'mup_threshold' => S3_UPLOAD_PART_SIZE, + $uploader = new MultipartUploader($this->getConnection(), $stream, [ + 'bucket' => $this->bucket, + 'key' => $urn, 'part_size' => S3_UPLOAD_PART_SIZE ]); + $uploader->upload(); } /** |