08-13-2013 06:10 AM
I have developed app for BlackBerry os 7 or earlier using webworks.
But, when the app shows image (using <img src='.....' />), I can't find menu to save image like we could see in blackberry browser. How to show the menu for save image?
What about upload images? I have tried extension webworks.io.FileUploader, but it always said that the extension is undefined. Is there any other extension for upload file (especially for images)?
Solved! Go to Solution.
08-20-2013 03:25 PM
Hi there, do you mean to bring up a Context Menu for the image inside a WebWorks application? It should come up by default for images you have added as long as you have not specified a custom Context Menu:
Are you able to share a basic index.html that you can produce the issue with?
For uploading, I would recommend the FileTransfer APIs:
08-20-2013 09:50 PM - edited 08-20-2013 09:52 PM
Thanks for your reply, oros.
Yes. It is the context menu for save the image. But, how to do it in blackberry os 7 or earlier? how to save image from <img src='...' /> to the local blackberry folder?
I am using bbui.js and the image is not in the index.html.
<div data-bb-type='screen' id='thePage'>
<img id='theImage' src='http://www......com/images/test.jpg' x-blackberry-focusable='true' onmouseover='highlight(this)' onmouseout='unhighlight(this) ' />
Regarding to the uploading, blackberry.io.filetransfer is used for blackberry 10. Is there any equivalent api for blackberry os 7 or earlier? or could we use the <input type='file' /> to upload file? Is there any documentation about this?
08-21-2013 12:30 PM
Ah, apologies. I missed the BBOS7 and earlier comment.
Indeed the FileUploader community API is the way to go:
Have you followed these steps to install the extension?
Could you share a screenshot of the webworks.io.FileUploader folder, including the full path to the folder? Also, when you are packaging with the bbwp command, can you please share the full output of the packager, along with your config.xml file?
On Legacy BBOS, we don't have a context menu. You will actually need to write the filesystem access / saving implementation yourself. You may be able to re-use the FileDownload API:
Or do something similar to the canvasToFilesystem sample here:
Note that the canvasToFilesytem is for BB10, but the core API functionality is HTML5 so should work on BBOS7 and BBOS6.
09-25-2013 09:17 PM
I have tried FileUploader and FileDownloader but it is not working.
In the ripple emulator console, it shows error "webworks is undefined"
I have created webworks.io.FileUploader. It contains library.xml and folder webworks (that contains fileUploader source code).
I have created webworks.io.FileDownloader. It contains library.xml and folder webworks (that contains fileDownloader source code).
In config.xml, I have added these lines:
<feature id='webworks.io.FileUploader' />
<feature id='webworks.io.FileDownloader' />
and I have arranged the <rim:connection>, too.
But, it is not working. I think I have made mistake when configuring the extension.
Could you help me?
09-30-2013 05:27 PM
10-04-2013 10:11 AM
I have packaged it and it works!
But, how to show the file picker when I want to upload a file, is this possible to use <input type='file' />?
10-04-2013 02:10 PM
The file input tag won't really do what you want, in the case of a WebWorks app. However, there is a community extension that provides a FilePicker. Check it out here:
10-31-2013 02:09 PM