cannot get move to work in pone gap at all. my code is below can anyone please help

1,743 views
Skip to first unread message

jamiemac...@googlemail.com

unread,
Aug 24, 2011, 8:25:27 AM8/24/11
to phonegap
cannot get moveto to work spent all morning on it. please can someone
help? I get a code error 1 in return

code is below

window.resolveLocalFileSystemURI(imageURI, resOnSuccess, resOnError);

function resOnSuccess(entry){

var parent = "sdcard/SingleSurvey_4/",
success,
resOnError);,
parentEntry = new DirectoryEntry({
fullPath:parent
});



// move the file to a new directory and rename it
entry.moveTo(parentEntry, "newFile.jpg", success, resOnError);
}

function resOnError(entry){

alert(entry.code)

}

function success(entry){

alert('copied file');

}

Simon MacDonald

unread,
Aug 24, 2011, 2:48:00 PM8/24/11
to phon...@googlegroups.com
When you speak of me, speak well.

function movePic(){
window.resolveLocalFileSystemURI(imageUrl, resOnSuccess, resOnError);
}

function resOnSuccess(entry){

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSys) {
fileSys.root.getDirectory("SingleSurvey_4", {create:
false, exclusive: false},
function(directory) {
entry.moveTo(directory, "newFile.jpg",
success, resOnError);
}, resOnError);
}, resOnError);
}

Simon Mac Donald
http://hi.im/simonmacdonald

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>

jamiemacdonald04

unread,
Aug 25, 2011, 5:41:58 AM8/25/11
to phon...@googlegroups.com, simon.m...@gmail.com
It still does not seem to work.  I am using the url straight from the camera  with no joy.  It is a Samsung galaxy, the url that is returned states with content.  do you think that is what is wrong 

Bas Grootjans

unread,
Jan 3, 2013, 8:24:09 AM1/3/13
to phon...@googlegroups.com
Thank you so much simon!!!

John Ryan Robles

unread,
Apr 16, 2014, 3:25:59 AM4/16/14
to phon...@googlegroups.com
Hi Simon, What Phonegap version and Plugin Version of file and file-transfer are you using for iOS? Thanks.

Oscar Baeza

unread,
May 29, 2014, 1:43:40 PM5/29/14
to phon...@googlegroups.com
Perfect Code... thanks!!!
Reply all
Reply to author
Forward
0 new messages