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
Highlighted
New Developer
New Developer
Posts: 10
Registered: ‎10-04-2012
My Device: Blackberry 10 dev alpha

HTML5 Filesystem API - undefined window.webkitRequestFileSystem

Hi.

I'm developing using the HTML5 APIs both for playbook and BB10.

To access the filesystem I use window.webkitRequestFileSystem, which works fine in Chrome, but in the playbook that property is not defined. 

¿How can I access the HTML filesystem?

Thanks in advance.

BlackBerry Development Advisor
Posts: 762
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: HTML5 Filesystem API - undefined window.webkitRequestFileSystem

[ Edited ]

Try this when you're setting up your filesystem

 

window.requestFileSystem  = window.requestFileSystem || window.webkitRequestFileSystem;

 Here's a good tutorial on the HTML5 File API that might come in handy: http://net.tutsplus.com/tutorials/html-css-techniques/toying-with-the-html5-filesystem-api/

New Developer
New Developer
Posts: 10
Registered: ‎10-04-2012
My Device: Blackberry 10 dev alpha

Re: HTML5 Filesystem API - undefined window.webkitRequestFileSystem

Thank you Chad. That's the tutorial I was following.

None window.requestFileSystem || window.webkitRequestFileSystem exists.

The documentation says that there's no need to declare an extra feature in the config.xml... I'm also using the lastest webworks for playbook.

When I run this code in the playbook it fails on the second line, because window.requestFileSystem is undefined.

window.requestFileSystem  = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(window.TEMPORARY, 5*1024*1024, initFS, errorHandler);

 

¿Is there an example tested in the playbook? The kitchenSink doesn't use this function. I want to use it in order to save private files in the application.

 

Thanks.