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

Native Development

Reply
Developer
Posts: 63
Registered: ‎12-16-2011
My Device: Red 10

Open file with absolute file path?

Hi

 

Im using the FilePicker to pickup a file. In the fileSelected() slot, I'm trying to open the selected file but it always return false:

 

filePath value is "/accounts/1000/shared/camera/img256.jpg"

 

QFile f(filePath);

f.open(QIODevice::ReadOnly);

 

if(f.size()>0)

{
fsize->setText("found file");
}

else

if(f.size()>0)
{
fsize->setText("file not found");
}

 

Please correct me if anything missing?

 

Thanks

Developer
Posts: 1,523
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Open file with absolute file path?

Hi,

Make sure that 'access_shared' permission is set in bar-descriptor.xml

Andrey Fidrya, @zmeyc on twitter