Created
June 9, 2017 15:46
-
-
Save matthieu-D/7274ee3bc5d060e9f2ddcff8f3dbf204 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
upload(loading: any) { | |
let self = this; | |
if (self.selectedPhoto) { | |
this.s3.upload({ | |
'Key': 'protected/' + self.sub + '/avatar', | |
'Body': self.selectedPhoto, | |
'ContentType': 'image/jpeg' | |
}).promise().then((data) => { | |
this.refreshAvatar(); | |
console.log('upload complete:', data); | |
loading.dismiss(); | |
}).catch((err) => { | |
console.log('upload failed....', err); | |
loading.dismiss(); | |
}); | |
} | |
loading.dismiss(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment