@chris_held927 wrote:
Hi,
I'm getting some weird quirks when attempting to display images that I'm saving to the
dataDirectoryusing the File plugin. I'm saving a photo, then storing that photo's location and displaying it in an image tag. Everything works fine the first time through, the picture saves, I store the location, and the image shows. However, when I restart the app and try to point to that file again, nothing shows up. Here is the code I'm working with:me.file.writeFile(cordova.file.dataDirectory, filename, data, true).then(function(result){ console.log('file was saved'); console.log(result); me.item.images.push(cordova.file.dataDirectory + filename); //save the inspection and go back me.inspectionProvider.save(me.inspection).then(ins => { me.navCtrl.pop(); }) }).catch(function(err){ console.log("Could not save photo"); console.log(err); me.toastCtrl.create( { message: "Could not save photo", position: "bottom", duration: 2000 } ).present(); })The resulting
imagesarray looks something like this:["file:///var/mobile/Containers/Data/Application/F42598F1-063A-410F-9107-F99CE6C215B3/Library/NoCloud/b1ca377b-3003-0b43-bc80-0c9c9ba04d85.jpg"]I've confirmed that the array contents don't change across restarts, and I've verified that the file is indeed there. Can anyone help point me in the right direction?
Thanks
Posts: 1
Participants: 1