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: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

return QFile::copy(fromPath, toPath); from the web

Is there a way to use 

 

return QFile::copy(fromPath, toPath);

 

But instead of copying local files, copy a file from the web?

 

 

If not what is the best alternative? 

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: return QFile::copy(fromPath, toPath); from the web

QFile's constructors only take strings that represent paths to files on the device and not URIs. You should probably take a look at using QnetworkAccessManager ( see examples here  https://developer.blackberry.com/native/reference/cascades/qnetworkaccessmanager.html  ) perhaps wrapping it in a class to make it easy to use if you intend to reuse the functionality.