Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active July 17, 2016 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/dd1d670c60aefede93b49b87431b0723 to your computer and use it in GitHub Desktop.
Save matthieu-D/dd1d670c60aefede93b49b87431b0723 to your computer and use it in GitHub Desktop.
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