Okay, palm just released the downloadmanager API, but I'm having troubles using it to download images from a website. Crazy thing is I can see the image file when I USB mount my phone, but it doesn't show up in the photos app. ANyone know how to tackle this?
sample:
this.controller.serviceRequest('palm://com.palm.downloadmanager/', {
method: 'download', // - will download specified file
parameters: {
target: "http://blogs.theage.com.au/schembri/qos2.jpg",
targetFilename: 'ddt.jpg',
keepFilenameOnRedirect: false,
subscribe: true
},
onSuccess : function (resp){
Mojo.Log.info('RESPONSE Success: ' + Object.toJSON(resp));
this.controller.get('area-to-update').update("Download to " + resp.target )}.bind(this),
onFailure : function (e){
Mojo.Log.info('RESPONSE Failure : ' + Object.toJSON(e));
this.controller.get('area-to-update').update("Download failed, " + e.errorCode + " : " + e.errorText)}.bind(this)