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
Posts: 31
Registered: ‎05-09-2011
My Device: OS6
My Carrier: AT&T

blackberry.io.file.open can not works on 9800 OS6.

hi, I just try to open the file from webwork as below code. But it can not works at 9800 latest ROM." 9800jAllLang_PBr6.0.0_rel2342_PL6.6.0.195_A6.0.0.526_AT_T.exe".  But it can works fine at 9800 simulator.  Is it a 9800 OS issue?

 

    try {
      if (path != null  && blackberry.io.file.exists(path)) {
             blackberry.io.file.open(path);
      }
    } catch  (e){
      Logger.error("idOpenMenuClick error" + e);
      alert("Open dump file failed : " + e);
    }

 

your reply will be appreciated. Smiley Happy Thanks.

Developer
Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: blackberry.io.file.open can not works on 9800 OS6.

Make sure you've got the permissions right in config

 

<feature id="blackberry.io.file" />

Plus - optionally

 

<feature id="blackberry.io.dir" />




Click the like button if you find my posts useful!
Contributor
Posts: 31
Registered: ‎05-09-2011
My Device: OS6
My Carrier: AT&T

Re: blackberry.io.file.open can not works on 9800 OS6.

yes, I add the below features, it still can  not work. is it a platfrom issue?

 

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

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

Re: blackberry.io.file.open can not works on 9800 OS6.

Can you post up your file path... Maybe you are accessing a path that is configured in the simulator that is not on your device.

 

File.io definately works on both BB5 and BB6 devices.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Contributor
Posts: 31
Registered: ‎05-09-2011
My Device: OS6
My Carrier: AT&T

Re: blackberry.io.file.open can not works on 9800 OS6.

hi Tneil,

 

Thanks for reply. The file path is file:///store/home/user/aaa/testPic.jpg. We save it in the phone.

and blackberry.io.file.exists(path) returns true. Any comments?

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

Re: blackberry.io.file.open can not works on 9800 OS6.

When you mention you are using the "latest ROM"... it is hard to tell which OS version you are using... Can you post the version number 6.0.0.X

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: blackberry.io.file.open can not works on 9800 OS6.

Hi Roy

 

My 9800 is a SIM-Free UK 6.0.0.246, (Bundle 695, Platform 6.4.0.105)

 

If you PM me I'll give you my mail addy so you can send me a copy of a test I'll check it out on mine

 

I also have a Storm 2 (OS5) should you need OS5 tests and my PB is en-route

 

I sort of hope yours is not as up to date as mine as I shortly need to test this functionality myself so that we can all trap the error scenario - i.e., it works on mine but not yours as you possibly have a slightly older OS

 

I realize you wanna get your app working ASAP but checking stuff like this is rather important




Click the like button if you find my posts useful!
Contributor
Posts: 31
Registered: ‎05-09-2011
My Device: OS6
My Carrier: AT&T

Re: blackberry.io.file.open can not works on 9800 OS6.

@Tneil, We have installed 9800jAllLang_PBr6.0.0_rel2342_PL6.6.0.195_A6.0.0.526_AT_T.exe on my 9800 phone.  Bundle 2342 (v6.0.0.526, platform 6.6.0.195). 

 

@peardox, Thanks for your kindly help. But I havn't test code yet. As i past my code on frist message. there is no more other code now. The scenario is very simple. Our App is Blackberry widget. it receive file from another client, then try to open it by using blackberry.io.file.open(), but it haven't any response.

 

If you want more information please let me know. And I want to know, if blackberry.io.file.open() works fine on Bundle 2342 (v6.0.0.526, platform 6.6.0.195)? Or if there is an workaround? Many thanks.

Developer
Posts: 1,230
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: blackberry.io.file.open can not works on 9800 OS6.

As you don't have any test code I took the code example from the api and tried that out

 

That don't work either

 

Examination of the script reveals that when you get to...

 

  blackberry.io.file.saveFile(filePath, blob_data);

1) blob_data is undefined

2) The script falls over at that line

 

A full set of io and util permissions were added to the test which fails on the 9800 sim




Click the like button if you find my posts useful!
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: blackberry.io.file.open can not works on 9800 OS6.


peardox wrote:

As you don't have any test code I took the code example from the api and tried that out

 

That don't work either

 

Examination of the script reveals that when you get to...

 

  blackberry.io.file.saveFile(filePath, blob_data);

1) blob_data is undefined

2) The script falls over at that line

 

A full set of io and util permissions were added to the test which fails on the 9800 sim


documentToBlob() will fail on a 6.0 device as it is only supported on OS5.  

 

I have filed an issue against the JavaScript API docs:

https://github.com/blackberry/WebWorks-API-Docs/issues/143

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter