Skip to main content

Function: detectMediaKind()

detectMediaKind(link): Promise<MediaKind>

Defined in: media/detect.ts:73

Detects how to send a link: first by file extension, then (for http/https links) by the Content-Type header via a HEAD request, falling back to 'document', which always works. Presigned URLs may reject HEAD; in that case the extension usually resolves it, otherwise it is sent as a document.

Parameters

string

Returns

Promise<MediaKind>