Last active
July 17, 2016 22:45
-
-
Save matthieu-D/dd1d670c60aefede93b49b87431b0723 to your computer and use it in GitHub Desktop.
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
export class ImportFilePage { | |
constructor() { } | |
fileEvent(fileInput: any){ | |
var AWSService = window.AWS; | |
var file = fileInput.target.files[0]; | |
AWSService.config.accessKeyId = 'SpongeBob'; | |
AWSService.config.secretAccessKey = 'Power'; | |
var bucket = new AWSService.S3({params: {Bucket: 'Ice'}}); | |
var params = {Key: file.name, Body: file}; | |
bucket.upload(params, function (err, data) { | |
console.log(err, data); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment