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
Posts: 2
Registered: ‎12-27-2013
My Device: BB10 - Webworks / Cordova
My Carrier: Dubai - du
Accepted Solution

BB10 Webworks/Cordova Opening External HTML pages on device: "This file could not be found. Check the URL and try again."

[ Edited ]

Hi fellow people,

 

Im fairly in my Cordova/Webworks application which downloads and saves an html file to the sd card (blackberry.io.sharedFolder). 

At this point the config.xml file is set as:

 

<access origin="*"subdomains="true"uri="*" />

    <preference name="websecurity"value="disable" />

    <rim:permissions>

        <rim:permit>read_device_identifying_information</rimSmiley Tongueermit>

        <rim:permit>access_shared</rimSmiley Tongueermit>

    </rimSmiley Tongueermissions>

 

 

Now, Im trying to open the downloaded html file which is saved at: 

 

/accounts/1000/removable/sdcard/MainFolder/SubFolder/file.html

 

From my WebApp, I am trying to open that as: window.open(path, _self);

Where path is the above file (that does exist on the device!) 

Also, path is with the blackberry.io.SharedFolder + "/MainFolder/SubFolder/file.html" < of that syntax.

 

So, I get the error:

This file could not be found. Check the URL and try again. If the URL is correct, check that your media card is properly inserted on to your device.

 

I'm running and developing off the BB10 Simulator. 

 

The console doesn't throw any error as far as I can see.

 

Any help or guidence would be appreciated.

 

Cheers,

@varunasingh

New Developer
Posts: 2
Registered: ‎12-27-2013
My Device: BB10 - Webworks / Cordova
My Carrier: Dubai - du

Re: BB10 Webworks/Cordova Opening External HTML pages on device: "This file could not be found. Check the URL and try again."

Okay, this is awkward. 

 

I fixed this myself by appending the string: "file://" to my path. 

I hope others see this before they get too stuck.

 

This is solved. Thanks for reading.

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

Re: BB10 Webworks/Cordova Opening External HTML pages on device: "This file could not be found. Check the URL and try again."

Thanks for the update.

 

This is one of the most common mistakes made when dealing with the filesystem. I've fallen victim to it as well Smiley Happy