Last active
March 27, 2020 03:02
-
-
Save ppshein/a3975e90ed9089d5a1d11d4ba59e35d7 to your computer and use it in GitHub Desktop.
Revisions
-
ppshein revised this gist
Mar 27, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ AWS.config.update({ const params = { Bucket: `mobile-ayaplus-backend-dev`, Key: `ayapay-merchant/mytestimage.png`, Body: fs.createReadStream(`./mytestimage.png`), ContentType: 'image/png', StorageClass: 'STANDARD_IA' -
ppshein revised this gist
Mar 27, 2020 . No changes.There are no files selected for viewing
-
ppshein renamed this gist
Mar 27, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ppshein created this gist
Mar 18, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ const AWS = require("aws-sdk"); const s3 = new AWS.S3({ apiVersion: "2006-03-01" }); const fs = require("fs"); AWS.config.update({ accessKeyId: "", secretAccessKey: "", region: "ap-southeast-1", Bucket: "mobile-ayaplus-backend-dev", }) const params = { Bucket: `mobile-ayaplus-backend-dev`, Key: `tmp/mytestimage.png`, Body: fs.createReadStream(`./mytestimage.png`), ContentType: 'image/png', StorageClass: 'STANDARD_IA' }; s3.upload(params, function(err, result) { if (err) { throw err; } console.log(`File uploaded successfully. ${JSON.stringify(result)}`); });