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
Contributor
genration
Posts: 34
Registered: ‎05-28-2011
My Device: Blackberry Playbook

Error #2004 - blackberry.io.file.saveFile

The following code results in this error on PlayBook 1.0.7 OS. Any ideas what causes it and why? Also appropriate permissions are in config.xml under the widget element as shown below.

 

try
{

var dirs = blackberry.io.dir.appDirs;
var filePath = dirs.shared.documents.path + "/test.txt";


var fileBlob = blackberry.utils.stringToBlob("12345");
blackberry.io.file.saveFile(filePath,
fileBlob);
}
catch(ex)
{

window.alert(ex.message);

}

 

 

<rim:smileytongue:ermissions>
<rim:smileytongue:ermit>access_shared</rim:smileytongue:ermit>
</rim:smileytongue:ermissions>

Retired
Tohman
Posts: 34
Registered: ‎10-24-2011
My Device: Curve

Re: Error #2004 - blackberry.io.file.saveFile

Make sure you have coresponidng entries for feature id (e.g blackberry.io.dir and blackberry.io.file) in your config.xml.

 



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Contributor
genration
Posts: 34
Registered: ‎05-28-2011
My Device: Blackberry Playbook

Re: Error #2004 - blackberry.io.file.saveFile

Sorry. They are already there. Forgot to mention.

Retired
Tohman
Posts: 34
Registered: ‎10-24-2011
My Device: Curve

Re: Error #2004 - blackberry.io.file.saveFile

In that case I suspect you're using the old version of Tablet OS SDK, please download the recent version here.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)
Contributor
genration
Posts: 34
Registered: ‎05-28-2011
My Device: Blackberry Playbook

Re: Error #2004 - blackberry.io.file.saveFile

Nope, I am using 2.2.
Retired
Tohman
Posts: 34
Registered: ‎10-24-2011
My Device: Curve

Re: Error #2004 - blackberry.io.file.saveFile

Your sample works for me, see if you have valid config.xml and archive structure, you can compare yours with This.



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)