15 Sep 2012 17:04
where to save images so they won't be deleted ? - I'm using latest ios - cordova 1.7.0
Hello,
My application allows the user to take a picture and save it on the device. I'm copying the images from the tmp folder to another location according to the following, because if they stay there they will be deleted:
window.resolveLocalFileSystemURI(sessionStorage.recipePicture, resCopyOnSuccess, resCopyOnError);
function resCopyOnSuccess(entry){
var currentTime = new Date();
fileAndExt = "image" + (currentTime.getMonth() + 1) + currentTime.getDate() + currentTime.getFullYear() + currentTime.getTime();
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSys) {
fileSys.root.getDirectory("recipe", {create:
true, exclusive: false},
function(directory) {
entry.copyTo(directory, fileAndExt, copySuccess, copyError);
localStorage.hasTmpImage = '';
}, resCopyOnError);
}, resCopyOnError);
}
With this code the location will be:
file://localhost/var/mobile/applications/DC1.../documents/recipe/imageName
But after an ios update the images are deleted. Where is the right place to save an image (a place where it won't be deleted)?
Thanks for your help,
Fernando
-- -- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phonegap-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
phonegap+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
For more info on PhoneGap or to download the code go to www.phonegap.com
To compile in the cloud, check out build.phonegap.com
RSS Feed