Im Using Ionic Image Picker(Native) to Get Multiple Images to an array.in array file look like this
file:///data/user/0/io.ionic.starter/cache/tmp_IMG_20180520_182034263619941.jpg
My ionic Image Picker Code is Here
getImages(){
let option = {
title:"Selec Your Images",
message:'You can only select 5 Images',
maximumImagesCount:5,
outType:1
}
this.imgPicker.getPictures(option).then((results) => {
for(let i=0; i < results.length;i++){
console.log(results[i]);
this.images[i]=results[i];
};
},(err)=> {
console.log("Get Image faild");
})
I Use This Method To Upload File and Get the Download URL But it Didn’t Work.Even File Not Uploaded To The Firabase Storage.
if(this.images.length > 0){
for (var i=0; i<this.images.length; i++) {
firebase.storage().ref('/images').putString(this.images[i], 'data_url',{contentType: 'image/jpg'}).then((data)=>{
this.userPost.photos[i]=data.downloadURL
console.log( 'this is download url '+this.userPost.photos[i]);
})
}
}
Im Stuck In This Problem Long Time.