mime_to_ext: MIME type to file extension

mime_to_extR Documentation

MIME type to file extension

Description

Determines a suitable file extension from a MIME type, based i.a. on mime::mimemap and mime:::mimeextra. In case of multiple matches, the first one is returned and a warning is printed (unless quiet = TRUE).

Usage

mime_to_ext(mime_type, quiet = FALSE)

Arguments

mime_type

MIME type to determine the file extension for. A character scalar.

quiet

Whether or not to suppress printing status output from internal processing.

Value

A character scalar.

Examples

pal::mime_to_ext("application/json")
pal::mime_to_ext("audio/mpeg")

salim-b/pal documentation built on Feb. 28, 2025, 6:51 p.m.