code: function addFiles (formData, files) {
      var file, arr, key, i = 0, filename;
  
      for (key in files) {
          if (files.hasOwnProperty(key) && files[key]) {
  
              if (files[key] instanceof Array) {
                  arr = files[key];
                  filename = getFilename(arr[i]) || null;
  
                  for (i = 0; i < arr.length; i += 1) {
                      formData.append(key + '[' + i + ']', arr[i]);
                  }
              } else {
                  file = files[key];
                  filename = getFilename(file) || null;
                  formData.append(key, file, filename);
              }
          }
      }
  }
docs: Helper used by `formRequestPayload` to append files to a FormData instance