code: function saveImage(data, success, fail) {
      var name = savePath + imgName();
      require('lib/webview').setSandbox(false);
      window.webkitRequestFileSystem(window.PERSISTENT, 0, function (fs) {
          fs.root.getFile(name, { create: true }, function (entry) {
              entry.createWriter(function (writer) {
                  writer.onwriteend = function () {
                      success(name);
                  };
                  writer.onerror = fail;
                  writer.write(dataURItoBlob(data));
              });
          }, fail);
      }, fail);
  }
docs: save dataURI to file system and call success with path