code: function(zip, model) {
      return PromishLib.Promish.all(model.media.map(function(medium) {
        if (medium.type === 'image') {
          var filename = 'xl/media/' + medium.name + '.' + medium.extension;
          if (medium.filename) {
            return fsReadFileAsync(medium.filename)
              .then(function(data) {
                zip.append(data, {name: filename});
              });
          }
          if (medium.buffer) {
            return new PromishLib.Promish(function(resolve) {
              zip.append(medium.buffer, {name: filename});
              resolve();
            });
          }
          if (medium.base64) {
            return new PromishLib.Promish(function(resolve) {
              var dataimg64 = medium.base64;
              var content = dataimg64.substring(dataimg64.indexOf(',') + 1);
              zip.append(content, { name: filename, base64: true });
              resolve();
            });
          }
        }
        return PromishLib.Promish.reject(new Error('Unsupported media'));
      }));
    }
docs: ========================================================================= Write