I’m trying to upload a pdf from ionic 3 app to firebase. by using this method I can upload a text file by just creating them.
uploadToStorage(information):AngularFireUploadTask
{
let newName = `${new Date().getTime()}.txt`;
return this.afST.ref(`files/${newName}`).putString(information);
}
here is the place where i call the function
uploadInfo(text)
{
let upload = this.dataProvider.uploadToStorage(text);
upload.then(res=>{
console.log('res',res);
this.dataProvider.storeInfoOnDatabase(res.metadata,text).then(()=>{
let toast = this.toastCtrl.create({
message : 'New File Added',
duration: 3000
});
toast.present();
});
});
}
what i need to do is how i expand the uploadstorage()
function to upload a file getting from ionic file chooser??