Browse Source

s3: Pass result of completeMultipartUpload() to onSuccess()

Renée Kooi 7 years ago
parent
commit
b43004384b
2 changed files with 5 additions and 5 deletions
  1. 4 4
      src/plugins/AwsS3/Multipart.js
  2. 1 1
      src/plugins/AwsS3/MultipartUploader.js

+ 4 - 4
src/plugins/AwsS3/Multipart.js

@@ -134,11 +134,11 @@ module.exports = class AwsS3Multipart extends Plugin {
           err.message = `Failed because: ${err.message}`
           reject(err)
         },
-        onSuccess: () => {
-          this.uppy.emit('upload-success', file, upload, upload.url)
+        onSuccess: ({ location }) => {
+          this.uppy.emit('upload-success', file, upload, location)
 
-          if (upload.url) {
-            this.uppy.log('Download ' + upload.file.name + ' from ' + upload.url)
+          if (location) {
+            this.uppy.log('Download ' + upload.file.name + ' from ' + location)
           }
 
           resolve(upload)

+ 1 - 1
src/plugins/AwsS3/MultipartUploader.js

@@ -226,7 +226,7 @@ class MultipartUploader {
         parts: this.parts
       })
     ).then((result) => {
-      this.options.onSuccess()
+      this.options.onSuccess(result)
     }, (err) => {
       this._onError(err)
     })