head
Fetch an object's metadata without its body - one key or many. Returns FileInfo; call download for the bytes.
files.head(key) · files.head(keys)
Returns the object’s FileInfo: its key, size, content type, ETag, last-modified time, and user metadata. There’s no body on the result; call download to read the bytes.
const info = await files.head("avatars/abc.png");
// → { key: "avatars/abc.png", size: 48213, contentType: "image/png", etag, lastModified, metadata }
Many keys
Pass an array to fetch metadata for many in one call. Returns { results, errors? } instead of throwing on partial failure (a missing key lands in errors), honoring concurrency / stopOnError.
const result = await files.head(["avatars/a.png", "avatars/b.png"]);
result.results; // FileInfo[] — successes, in the order supplied
result.errors; // undefined when every key succeeded