Skip to main content

encode_file_base64

Function encode_file_base64 

Source
pub async fn encode_file_base64(path: &Path) -> Result<String, MediaError>
Expand description

Read a local file and encode it as a base64 data URL.

The MIME type is inferred from the file extension. Returns a string like “data:image/png;base64,…”.