Skip to content

Commit c22d6c3

Browse files
Merge branch 'beta' of github.com:SoftwareBrothers/admin-bro-upload into beta
2 parents 1ae37cd + 6b8909e commit c22d6c3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@admin-bro/upload",
3-
"version": "1.2.0-beta.1",
3+
"version": "1.2.0-beta.2",
44
"main": "index.js",
55
"types": "types/index.d.ts",
66
"private": false,

src/features/upload-file/providers/aws-provider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export class AWSProvider extends BaseProvider {
5757
}
5858

5959
public async upload(file: UploadedFile, key: string): Promise<S3.ManagedUpload.SendData> {
60-
const tmpFile = fs.readFileSync(file.path)
60+
const uploadOptions = { partSize: 5 * 1024 * 1024, queueSize: 10 }
61+
const tmpFile = fs.createReadStream(file.path)
6162
const params: S3.PutObjectRequest = {
6263
Bucket: this.bucket,
6364
Key: key,
@@ -66,7 +67,7 @@ export class AWSProvider extends BaseProvider {
6667
if (!this.expires) {
6768
params.ACL = 'public-read'
6869
}
69-
return this.s3.upload(params).promise()
70+
return this.s3.upload(params, uploadOptions).promise()
7071
}
7172

7273
public async delete(key: string, bucket: string): Promise<S3.DeleteObjectOutput> {

0 commit comments

Comments
 (0)