Quote Originally Posted by devwithoutpower View Post
Here is workaround for secured downloads in Web app ...


Step 1: extract attached downloader.zip anywhere on your device
Step 2: connect to device and run install.sh to install patch (uninstall.sh to revert changes)

Known issues:
- downloading from IP addresses won't work (service does not handle IP-address based cookies yet)
- there is no way to download file if file with same name already exists in /media/internal/downloads (ie you have to delete/rename existing file first, then retry downloading)
- "Downloader" does not hide itself after downloaded file is opened
- no download progress given
- some cookies can contain special characters that will break service from working


Since v0.0.6 it is possible to use Downloader app from other apps.

To get url downloaded into /media/internal/downloads put this into your app:
var launcher = enyo.create({kind: "PalmService", name : "launcher", service : "palm://com.palm.applicationManager", method : "open"});
launcher.call({"id":"xx.downloader", "params": { target : inUrl, caller : enyo.fetchAppInfo().id }});
After download is finished your app will be relaunched with response, so you can handle it in onRelaunch function.

onRelaunch: function(inSender, inEvent) {
	console.log('relaunch...' + inEvent.params.downloader);
If 'caller' parameter is not specified, then after successful download, document will be automatically opened.

Any questions / comments are welcome.

v0.0.6: callback now working + fix in url handling
v0.0.5: added option to enter login/password before downloading starts
v0.0.4: added support for IP address based URL
v0.0.3: if Downloader app is uninstalled/not-installed properly then Web app will fallback to original download bar
doesn't work they are mime type files