javascript - cordova file taken by camera moveTo persistent folder - failure -
i have problem copy photo temp directory persistent directory in cordova. code looks this:
$(document).on("click","#btn_bild_aufnehmen",function(){ var options = { destinationtype: camera.destinationtype.file_uri, sourcetype: camera.picturesourcetype.camera, }; navigator.camera.getpicture(function(imageuri){ window.requestfilesystem(localfilesystem.persistent, 0, function(filesys) { alert("folder create"); //the folder created if doesn't exist filesys.root.getdirectory( "appname/bildaufnahme", {create:true, exclusive: false}, function(directory) { alert("move file.."); imageuri.moveto(directory, "example.png",function(){ alert("show image"); $(".div_objektbild").css("background-image","url("+bildaufnahme_dir+"example.png)"); },function(error){ alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); }); console.log("release"); }, function(error){ alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); }); }, function(error){ alert('code: ' + error.code + '\n' + 'message: ' + error.message + '\n'); }); all alerts reached, except line alert("show image");. error callback of moveto function not called either. guess there wrong moveto-function. has suggestion wrong?
Comments
Post a Comment