Welcome!

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

Reply
New Contributor
Posts: 2
Registered: ‎02-13-2012
My Device: 9300
My Carrier: TIGO

blackberry.io.file.exists undefined

[ Edited ]

Hello, I have a problem with blackberry.io.file it's throwing undefined, here is my code

 

var filePath = "file://store/try.txt";
var blob_data = blackberry.utils.stringToBlob(elstring);
alert('blob');
try{
if (blackberry.io.file.exists(filePath)) { // <- this line is throwing the exception.
alert('blob2');
blackberry.io.file.readFile(filePath,handleOpenedFile);
}else{
alert('blob3'); 
blackberry.io.file.saveFile(filePath, blob_data);
}
}catch(ex){
alert(ex.message);  // undefined
}

 

Config

 


<feature id="blackberry.io.dir" required="true" />
<feature id="blackberry.io.file" required="true" />

 

 

Any help would be awesome 

 

 

EDIT: 

Blackberry smartphone OS5 i've tried in: curve 8520-8530 and a bold 9700

Highlighted
Contributor
Posts: 18
Registered: ‎08-03-2011
My Device: Torch & Playbook
My Carrier: Bell

Re: blackberry.io.file.exists undefined

[ Edited ]

If this is for the playbook the documentation states that you also have to have <rim: permit>access_shared</rim: permit> as well.  Not sure what platform you are on.

 

Nick

 

New Contributor
Posts: 2
Registered: ‎02-13-2012
My Device: 9300
My Carrier: TIGO

Re: blackberry.io.file.exists undefined

[ Edited ]

I'm sorry this question is about blackberry OS5 devices i've tried: curve 8530 8520 and a bold 9700