我想在捕获图像后重命名图像,当我拍照时文件名已成功更改但面临一些问题 1.我无法在图库中查看该图像但当我通过 FileManger 访问该文件夹时能够查看它。2.当我从图库中检索图像文件重命名失败...(错误代码1)
我正在使用 Cordova 2.5.0
function onPhotoURISuccess(imageURI) {
console.log("imageURI"+imageURI);
window.resolveLocalFileSystemURI(imageURI, gotFileEntry, fsFail);
var FullData = ord_key + ',' + fileURL;
var arr = FullData.split(",");
InsertIntoTableWithoutAlert(tablename, coloumnArr, arr);
var ImgTag = window.localStorage.getItem("ImgCount");
ImgTag = parseInt(ImgTag) + 1;
window.localStorage.setItem("ImgCount", ImgTag);
ImgTag = "#" + ImgTag;
var Image = $(ImgTag);
Image.css("display", "block");
Image.attr("src", fileURL);
}
function gotFileEntry(e) {
console.log("esss "+ e.fullPath);
var p = e.fullPath.substr(0, e.fullPath.lastIndexOf('/'));
console.log("psss "+p);
parentEntry = new DirectoryEntry(e.fullPath,p);
e.moveTo(parentEntry, "546sas.jpg", successa, fsFail);
//e.remove(successb,removefail);
}
function removefail(error) {
alert("failed with error code: removefail" + error.code);
}
function successb(f){
alert("Success");
}
function successa(f){
fileURL = f.toURL();
console.log("fileurl " + fileURL);
}
function fsFail(error){
alert("failed with error fsFail " + error);
}