【问题标题】:Change or edit image file name in phonegap在 phonegap 中更改或编辑图像文件名
【发布时间】:2014-12-15 10:45:06
【问题描述】:

是否可以更改或提供自定义图像文件名,而不是相机 API cordova 中的默认图像名称? [IOS 和 android 版本] Cordova 3.5.0 版本

【问题讨论】:

    标签: cordova camera phonegap-plugins cordova-plugins


    【解决方案1】:
    var captureSuccess = function (mediaFiles) {
       // SystemURI require string and path2 will deal it and must not use file:/(path)
       var path = mediaFiles[0].fullPath;
       var path2 = path.slice(0, 5) + "//" + path.slice(5);
       window.resolveLocalFileSystemURI(path2, successMoveTo, fail);
    }
    
    function successMoveTo(entry) {
        window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
            function (fileSys) {
               fileSys.root.getDirectory(folder, {create: true, exclusive: false},
                function (directory) {
                    entry.moveTo(directory, file,
                        success, fail);
            }, fail);
        }, fail);
    }
    

    【讨论】:

      猜你喜欢
      • 2012-05-10
      • 1970-01-01
      • 2011-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多