Phone Card Filetransfer.download Ripple / Chrome

I am working on a mobile application using jquerymobile / phonegap / cordova (2.0). I am trying to download some files from a stream (xml) and store them locally. This behavior only appears in the Chrome browser, which I use for debugging (with ripple).

How do I run chrome? Here we go:

/Apps/Google\Chrome.app/Contents/MacOS/Google\Chrome --disable-web-security --allow-file-access-from-files --allow-file-access

I am developing on a Mac. My plist file also has access *, and I added <feature name="http://api.phonegap.com/1.0/file"/> to my config.xml

I tried to upload several images with the following code:

 function downloadImage(url,filename,use){ if(use==="thumb") { filename = filename + ".png"; download(url, filename); }return filename; } function download(url, filename) { //writeLog(window.appRootDir.fullPath); ft = new FileTransfer(); ft.download( url, window.appRootDir.fullPath + "/" + filename, {}, {}); } 

It works fine in the simulator, but in chrome it does not work with the following error:

 TypeError ripple.js:477 TypeError: Cannot call method 'download' of undefined at n.exports.exec (chrome-extension://geelfhphabnejjhdalkjhgipohgpdnoc/ripple.js:477:26724) at FileTransfer.download (http://localhost/~binderf/www/a4/cordova-2.2.0.js:2753:5) at download (http://localhost/~binderf/www/a4/js/index.js:194:5) at downloadImage (http://localhost/~binderf/www/a4/js/index.js:182:9) at Element.<anonymous> (http://localhost/~binderf/www/a4/js/index.js:153:51) at Function.p.extend.each (http://localhost/~binderf/www/a4/js/jquery-1.8.2.min.js:2:14477) at p.fn.p.each (http://localhost/~binderf/www/a4/js/jquery-1.8.2.min.js:2:11151) at Element.<anonymous> (http://localhost/~binderf/www/a4/js/index.js:145:57) at Function.p.extend.each (http://localhost/~binderf/www/a4/js/jquery-1.8.2.min.js:2:14477) at p.fn.p.each (http://localhost/~binderf/www/a4/js/jquery-1.8.2.min.js:2:11151) ripple.js:477 FileTransfer FileTransfer ripple.js:483 download ripple.js:483 missing exec:FileTransfer.download 

a dialog box appeared with the message:

Filetransfer.download

It seems that we are missing some things :(

Interestingly, although you can fill in the text box to pass the json object to the callback you want to execute.

I see it undefined, but I can not understand what is actually my problem. If anyone has a suggestion or similar problem, please offer any suggestion.

+7
source share
1 answer

This is because the Ripple plugin for Chrome did not implement this feature. It will work in a real environment (for example, on the phone).

+10
source

All Articles