我希望在捕获图像后重命名图像,当我拍照时文件名被成功更改但面临一些问题 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);
}