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 Developer
Posts: 9
Registered: ‎06-24-2011
My Device: Developer
My Carrier: Tsel

BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

Hi,

 

With the new SDK release and File IO on PlayBook officially supported, I have question about this.

Can I download a file from server and save it to PlayBook using "blackberry.io.file.saveFile()"?

I have a webservice that will provide the file as a binary content and I'm thinking to use jQuery ajax to get the binary from the webservice. Is this possible?

 

Thanks,

Andrew

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

There is actually a glitch that went up with the API documents showing that read/save were supported in PlayBook.  These are not yet supported as we work though making Blob support work with the File API

 

We will be making these fixes to the API documents.

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

Hi Andrew,

 

Please follow this thread http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/WebWorks-SDK-v2-1-0-and-File-API... and see if its useful to you. Smiley Happy

New Developer
Posts: 9
Registered: ‎06-24-2011
My Device: Developer
My Carrier: Tsel

Re: BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

Thanks Praveen, I'll take a look at it.Smiley Happy

Contributor
Posts: 29
Registered: ‎06-17-2010
My Device: Bold 9700
My Carrier: Wind

Re: BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

[ Edited ]

Am I understanding this corectly?  You're saying we cannot save to the PlayBook at all right now? I've been waiting for this latest version of the SDK for that exact purpose...

 

I need to save some base64 data to an image, and received an 'Error 1304' usering saveFile.

Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

Yes, its not possible to save data to playbook with the existing API. Only a blobdata which is read from an existing file can be saved to another new file, which in a way is similar to copying a file. Smiley Wink For more details please see the thread  http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/WebWorks-SDK-v2-1-0-and-File-API...

 

But if you want to save some string information which in your case is a base64 decoded string to a file, you could write a custom javascript extension for this.

Contributor
Posts: 29
Registered: ‎06-17-2010
My Device: Bold 9700
My Carrier: Wind

Re: BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

Thanks Praveen,

I've been looking into how to do this without much luck, but will keep searching.

Glad to know that I should be able to do this some how.
Developer
Posts: 163
Registered: ‎05-06-2011
My Device: Playbook
My Carrier: Not Specified

Re: BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

Please check at SDK folder bbwp\ext. The extension blackberry.ui.dialog will be easier to understand. Follow the same pattern and you will surely end in good results Smiley Happy

Highlighted
Contributor
Posts: 29
Registered: ‎06-17-2010
My Device: Bold 9700
My Carrier: Wind

Re: BlackBerry WebWorks SDK 2.1 for Tablet OS File IO

That's above my head.

 

Looked in to using html5 and 'window.requestFileSystem' to save files to with no luck wither.  Looks like I'm out of luck.  

 

Wish I would have known a few weeks ago, I would have learned something new, rather than used JavaScript.