cordova - iOS / Phonegap : using FileTransfer response -


first, sorry if english bad.

then, here issue:

i try make app ios phonegap 2.8.1 . evrything going on android, want move code on xcode compile on ipad or iphone. probleme have filetransfer, when upload image. transfer has no problem, finishes response code 200, it's success. then, serve supposed return xml file, handled javascript code. server works fine, because have absolutly no problem android devices.

so, made lot of tests, , appears app has problem success callback or filetransfer.upload(). when put simple console.log('success') in callback function, it's fine. when try use fileuploadresult object, nothing happens.

and weirdest thing is, when press main button of ipad or iphone, in order close app, see logs displayed in debug window, such console.log("code = " + r.responsecode);, in phonegap example. , here, can see receive server response, it's blocks until close app.

here part of code :

function onphotodatasuccess(imageuri) {  console.log("---> image: "+imageuri);  // file transfer var options = new fileuploadoptions(); options.filekey="file"; options.chunkedmode = false; options.filename=imageuri.substr(imageuri.lastindexof('/')+1); options.mimetype="image/jpeg";  var ft = new filetransfer(); ft.upload(imageuri, encodeuri(window.localstorage.getitem("wsurl")), win, fail, options);  // transfer succeeded function win(r) {    console.log("code = " + r.responsecode);   console.log("response = " + r.response);   console.log("sent = " + r.bytessent);    // handle xml response    }   else {     alert("no response. please retry");   } }  // transfer failed function fail(error) {   alert("an error has occurred: code = " + error.code);   console.log("upload error source " + error.source);   console.log("upload error target " + error.target); }  } 

thanks help


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -