瀏覽代碼

Merge pull request #1257 from transloadit/feature/s3-name

s3: Use user provided filename / type for uploaded object, fixes #1238
Artur Paikin 6 年之前
父節點
當前提交
efc5e7716b
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      packages/@uppy/aws-s3/src/index.js

+ 2 - 2
packages/@uppy/aws-s3/src/index.js

@@ -70,8 +70,8 @@ module.exports = class AwsS3 extends Plugin {
       throw new Error('Expected a `serverUrl` option containing a Companion address.')
       throw new Error('Expected a `serverUrl` option containing a Companion address.')
     }
     }
 
 
-    const filename = encodeURIComponent(file.name)
-    const type = encodeURIComponent(file.type)
+    const filename = encodeURIComponent(file.meta.name)
+    const type = encodeURIComponent(file.meta.type)
     return this.client.get(`s3/params?filename=${filename}&type=${type}`)
     return this.client.get(`s3/params?filename=${filename}&type=${type}`)
       .then(assertServerError)
       .then(assertServerError)
   }
   }