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
BlackBerry Development Advisor
Posts: 170
Registered: ‎09-06-2010
My Device: Classic
My Carrier: Vodafone UK

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.

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim