Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Regular Contributor
Posts: 68
Registered: ‎06-12-2012
My Device: Blackberry Bold 9780
My Carrier: Vodafone

File API - Weird Errors

Hi BB developers.


I have the same  application running on the playbook in to 2 following ways:

  • Installed as a normal application
  • Installed in the work perimiter (via BDS)

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.jpg


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?