Skip to content

Instantly share code, notes, and snippets.

@shamique
Last active October 26, 2018 17:28
Show Gist options
  • Save shamique/d247d3471e4790247cc057fbbb183c6c to your computer and use it in GitHub Desktop.
Save shamique/d247d3471e4790247cc057fbbb183c6c to your computer and use it in GitHub Desktop.
uploadPhoto() {
let loading = this.loader.create({
title: 'Wait',
subTitle: 'Uploading...'
});
loading.present();
this.cognitoService
.getLoggedUser()
.then(userToken => {
this.s3Service.upload(this.imageData, this.imageName, userToken).then(
res => {
loading.dismiss();
this.imageName = "";
this.imageData = "";
alert("Image uploaded!");
},
err => {
loading.dismiss();
alert("Error in image upload!");
}
);
})
.catch(err => console.log(err));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment