Created
February 11, 2020 20:09
-
-
Save sebolio/3d2ab97f93848537c4f165b9e2479f26 to your computer and use it in GitHub Desktop.
Subir archivo a S3 usando signed url firmada mediante nodejs y curl
This file contains 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 characters
//S3 usa las credenciales en ~/.aws/credentials y/o variables de entorno | |
const s3 = new (require('aws-sdk')).S3() | |
//se crea una URL firmada por S3 a la cual podemos enviarle un archivo via PUT | |
s3.getSignedUrl('putObject', { Bucket: 'NOMBRE DEL BUCKET', Key: 'NOMBRE DEL ARCHIVO', Expires: 60 }, (e, url) => console.log(url)); |
This file contains 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 characters
curl -T 'NOMBRE DEL ARCHIVO' 'URL CREADA POR sign.js' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment