12-19-2012 11:59 AM
Hi BB developers.
I have the same application running on the playbook in to 2 following ways:
My app is simple it takes a picture, shows you it then allows you to delete it.
All the features work on the normal application but within the work perimiter it doesnt allow me to delete the file.
The file path for an example file is similar to: file:///accounts/1000/shared/camera/IMG_00000049.
When using the following code to delete that file it throws an "Error: Error #3012" and doesnt delete the file. This ONLY happens in the work perimiter but is fine when normally installed.
function deletePicture() {
try {
if(blackberry.io.file.exists(currentFilePath)) { //If its a real file
soMessageOnPage("Found file: " + currentFilePath); //Tell the user
blackberry.io.file.deleteFile(currentFilePath); //Try delete the file
soMessageOnPage("Deleted: " + currentFilePath); //Tel the user its been deleted
} else { //If it isnt a real file
soMessageOnPage("Path isnt real: " + currentFilePath);//Tell the user
}
} catch(e) {//Catch any errors
soMessageOnPage(e); //Display errors to user
}
}
Is there anyway to be able to delete an image from a work space applciation?
Thanks!