· 6 years ago · Jun 13, 2019, 09:42 PM
1S3.init({ endPoint: '', accessKey: '', secretKey: '', type: 'static' }); // <= Try calling this before the app starts
2
3const s = new S3();
4 const uploadingFileID = s.createUpload({
5 file: filePath,
6 bucketName: 'pc-profilepictures',
7 key: `1`,
8 acl: 'public-read',
9 completed: (error, success) => {
10 if (error) {
11 console.log(`Upload Failed :-> ${error.message}`);
12 }
13 if (success) {
14 console.log(`Upload Complete :-> ${success.path}`);
15 }
16 },
17 progress: progress => {
18 console.log(`Upload Progress: ` + progress.value);
19 }
20 });