我正在尝试在 FileEntry 上执行 copyTo 方法,但它失败了,错误代码为 1。我怀疑我没有给它它需要的东西。这是我提供给该方法的输入,其中哪个值不正确?在 android 上运行,但在 iOS 上也出现错误。我正在尝试按照 API 文档中的说明进行操作,但预期的输入尚不清楚。
var imageUri = 'file:///mnt/sdcard/Android/data/com.test.app/cache/resize.jpg?1337214925787';
var newFileName = 'test.jpg';
var directoryFullPath = 'file:///mnt/sdcard/App/Job';
window.resolveLocalFileSystemURI(
imageUri,
function (entry) {
console.log("Get file entry success, copy file");
var parentEntry = new DirectoryEntry({ fullPath: directoryFullPath});
entry.copyTo(
parentEntry,
newFileName,
function (newEntry) {
console.log("FileEntry copy to done. New Path: " + newEntry.fullPath);
},
function (error) {
console.log("FileEntry copy to fail. Error code: " + error.code);
}
...