08-07-2012 12:31 PM
hello -
having the worst trouble implementing filereader on my playbook app. i have the following in my config file:
<rim: permissions>
<rim: permit>access_shared</rim: permit>
<rim: permit>record_audio</rim: permit>
</rim: permissions>
so i figured i was okay with the permissions. kitchensink says to add <permission>access_shared</permission> in the bbwp\AirAppTemplates\src\blackberry-tablet.xml file. not sure what that means since that is in the SDK directory and not in my packaged zip file.
is the way i add the permission to the config file correct?
the problem i have is when i port the code for filereader to my app, and i click the input's 'Choose Files' button, nothing happens. in chrome - my testbed - it works fine which tells me the code works, but maybe the permission doesn't. i can't imagine why it won't pull up the file explorer. i'm just having the user choose music files to integrate into the app, so i basically need the file explorer to pull up so i can get the filename once they select the song they want.
any help would be appreciated. after 4.5 hours of just trying to get this working last night, any help would be greatly appreciated!
Solved! Go to Solution.
08-07-2012 02:12 PM
Hi. The way you added the permission isn't completely correct. From your example you have:
<rim: permissions>
<rim: permit>access_shared</rim: permit>
<rim: permit>record_audio</rim: permit>
</rim: permissions>
I marked/underlined the items that could cause your issues and you should use this instead:
<rim:permissions>
<rim:permit>access_shared</rim:permit>
<rim:permit>record_audio</rim:permit>
</rim:permissions>
Give this a try.
08-07-2012 02:15 PM
And some more thing to remember. To access the shared folder on the device you need the access element in the config.xml like this one:
// grant access to "everything" local+online <access subdomains="true" uri="*" />
08-07-2012 02:17 PM - edited 08-07-2012 02:18 PM
i'll take a look at this second point when i get home tonight. i should have mentioned i added the space intentionally in the post so it wouldn't turn : p into ![]()
i guess i should use the code sections!
thanks!
08-07-2012 09:08 PM - edited 08-07-2012 09:23 PM
the problem was with event.preventDefault in document.ontouchstart. is there a way to only prevent certain events. i want the input button to fire up the file browser, but i don't want my css3 buttons' text to be selected when i push those buttons. is there a way to do an if statement based on the event coming into the ontouchstart function?
***UPDATE***
used the following:
document.ontouchstart = function(event)
{
if(event.target.id != 'txtFile') event.preventDefault;
}
this allows me to just identify the 'Choose File' button from the input, and since the default isn't prevented i'm able to ignore everything else, but still bring up the file explorer.