How to retrieve file from internal phone memory
Is this question different from the nearly identical one you opened yesterday?
have you any solution?
No, otherwise I would provide it. Or maybe not, because I don’t like you posting the same stuff multiple times.
I am not getting the solution, so I post it again and again
Ok, that is not acceptable and appropriate. Maybe you should write a bit more than half a sentence: Include what problem you are trying to solve, what you already tried, what context you need that in etc.
I get the file path from internal memory and i don’t want to share the file path but i want to share raw file like image, video etc
below my code
share(event,item){
let getUrl = item._meta_gallery_images
let downloadFileName = getUrl.substr(getUrl.lastIndexOf('/') + 1);
this.file.checkFile(this.storageDirectory, downloadFileName)
.then(() => {
const alertSuccess = this.alertCtrl.create({
title: `File retrieval Succeeded!`,
subTitle: `${downloadFileName} was successfully retrieved from: ${this.storageDirectory}`,
buttons: ['Ok']
});
let finaleLink = this.storageDirectory+downloadFileName;
this.socialSharing.shareViaWhatsApp(
finaleLink +"\n"+
"Share via"+" "+this.appUrl
)
.then(()=>{
alert("Success");
},
()=>{
alert("failed")
})
return alertSuccess.present();
})
.catch((err) => {
const alertFailure = this.alertCtrl.create({
title: `File retrieval Failed!`,
subTitle: `${downloadFileName} was not successfully retrieved. Error Code: ${err.code}`,
buttons: ['Ok']
});
return alertFailure.present();
});
}
please help me how can i fix my issue
Thanks
shareViaWhatsApp(message: string, image?: string, url?: string): Promise<any> { return; }
try to use this in your case:
this.socialSharing.shareViaWhatsApp(
`Share via${this.appUrl}`,
null,
finaleLink
).then(() =>
...
You could also try to replace null
with your finalLink
, too.
this.socialSharing.shareViaWhatsApp(
`Share via${this.appUrl}`,
finaleLink,
finaleLink
).then(() =>
...
Thank you so much. where i’m wrong please tell me