08-04-2012 05:37 AM
Hi,
I want to download image from URL link and store the image in local folder in Webworks BB10.
But I didn't got code for this.
If any one know such code or having any solution then please help me....
Thanks & Regards,
Nitish Subudhi
Solved! Go to Solution.
08-04-2012 05:46 AM - edited 08-04-2012 05:47 AM
Try working with the WebWorks API documentation to get some pieces of source code to start working with the APIs. The easiest way to create a file download in BB10 is the new FileTransfer API and there is an example in the docs to get started.
08-04-2012 06:40 AM
Hi LBP,
can u please suggest me the code of file transfer for BB6 webworks..
I am working on a project in which i have to download the image to local folder and save the path in SQL database...
And i am checking the project in 9800 OS6.
Please help me...
Thanks & regards,
Nitish Subudhi
08-04-2012 06:59 AM
For BB SmartPhone OS 6/7 or PlayBook OS have a closer look to the WebWorks Community APIs, they created some great extensions to work with FileTransfer (FileDownload, FileUpload) almost the same way BB10 is working by default right now. The only difference between them using the extensions from WebWorks Community APIs seem to be the object the functionality for download files is assigned to. For SmartPhone/PB using the extension it is:
webworks.io.filetransfer
and using BB10 it is:
blackberry.io.filetransfer
Give it a try. I already worked with BB10 FileTransfer API and also using it for PlayBook and it worked quite well so far for the simple use cases.
08-04-2012 07:29 AM
08-04-2012 08:05 AM
NitishSubudhi wrote:
I go through this code.....but it is throwing exception. i.e " ReferenceError: Webworks is not defined ".
Depending on the device/OS you need to add the extension to your WebWorks installation like explained there for BB SmartPhone OS or for PlayBook OS.
For usage read the samples provided, they should work in any way. When I was working with the extension on PlayBook I only copy+pasted the provided sample source code and changed the attributes for the function call:
// You need to define "remotePath", "localPath", "onProgress", "onError", "options" like shown in documentation
blackberry.io.fileTransfer.downloadFile(remotePath, localPath, onProgress, onError, options);
For BB SmartPhone OS the function call looks like this:
// You need to define "options" like shown in documentation
webworks.io.FileDownloader.download(options);
All think all informations provide there, try to follow and it should work.
08-06-2012 07:08 AM
08-06-2012 07:35 AM
Good to know it was a solution for you! ![]()
11-01-2012 05:00 AM
Hi LBP,
I am using ripple emulator to test my app, but it is throwing exception. i.e " ReferenceError: Webworks is not defined ".
I go through the document but still i coudn't fix it.
Platform: Webworks version 2.0
Regards,
Sundaram
11-01-2012 05:09 AM
Hi sundaram,
The above code didn't work in ripple.... you have to check your code in the simulator.. for which you have to set the sdCard path.
Thanks & Regards,
Himansu