이것은 호출중인 onSuccess 함수이지만 moveTo
메서드는 원하는 효과를 제공하지 않습니다. 내 이미지를 file : /// storage/sdcard0/PhotoscanPhotos /로 이동해야하지만 디버깅 경고는 //PhotoscanPhotos
으로 표시됩니다.코르도바/Phonegap moveTo 루트 디렉토리를 가져 오지 않음
function movePhoto(fileEntry) {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSys) { //onsuccess
fileSys.root.getDirectory("PhotoscanPhotos", {create: true, exclusive: false}, function(dir) {
var guid = guidGenerator();
Speicher.setPhotoFolder(dir.fullPath);
alert(dir.fullPath); //debugging
fileEntry.moveTo(dir, (guid + "foto.jpg"), onMoveSuccess, onFail);
}, onFail);
}, onFail);
}
누구나 내가 뭘 잘못하고 있는지 알 수 있습니까? Phonegap 3.1 API 문서의 가상 복사본입니다. 나는 나의 설정 파일을 정확하게 가지고있다. 사전에
덕분에
편집 : 완성도에 대한 코드의 나머지 :
function takePicture() {
var code = $("#txtCode").val();
if(!code){
alert("Zuerst EAN-Code scannen oder eingeben.");
return false;
}else{
ean = code;
}
navigator.camera.getPicture(onPhotoURISuccess, onFail,
{ quality: 100, destinationType: Camera.DestinationType.FILE_URI });
return true;
}
function onPhotoURISuccess(imageURI) {
createFileEntry(imageURI);
showImageList();
}
function createFileEntry(imageURI) {
window.resolveLocalFileSystemURI(imageURI, movePhoto, onFail);
}
function movePhoto(fileEntry) {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSys) { //onsuccess
fileSys.root.getDirectory("PhotoscanPhotos", {create: true, exclusive: false}, function(dir) {
var guid = guidGenerator();
Speicher.setPhotoFolder(dir.fullPath);
alert(dir.fullPath); //debugging
fileEntry.moveTo(dir, (guid + "foto.jpg"), onMoveSuccess, onFail);
}, onFail);
}, onFail);
}
function onMoveSuccess(entry) {
var image = {ean:ean, image: entry.fullPath, timestamp:convertDateToUTC()};
alert(image.image); //debugging
getPhotoFolder();
alert(numOfPhotosStored + " photos stored"); //debugging
images.push(image);
Speicher.setImages(images);
showImageList();
}
function onFail(error) {
alert(error.code + error.message);
}