loadFileAsBase64URL

To convert a file to URL-compliant base64 format

This function converts a file into a URL-compliant base64 string. You can then use this in a REST API call, for example.

Syntax

loadFileAsBase64URL(file)

loadFileAsBase64URL(nid, string)

Return

string

Examples

loadFileAsBase64(record, fileName) To convert a given file from the attachment of a record to a base64URL format.

loadFileAsBase64URL(this, "myPhoto.jpg")

Ergebnis: data:image/gif;base64,R0lGODlhgACAAPYpAPDNPv///+fBL/L1+Nff6qp9HLWvhvj5+/n7/MKoYNGtQ5urunRTJey4Jfv8/f39/t/l7qmVZe3w9 ...

(a base64URL string was generated from the file "myPhoto.jpg" from the attachment of the current record)

loadFileAsBase64(datei) To convert a given file to a base64URL format.

loadFileAsBase64(Photo)

Ergebnis: data:image/gif;base64,R0lGODlhgACAAPYpAPDNPv///+fBL/L1+Nff6qp9HLWvhvj5+/n7/MKoYNGtQ5urunRTJey4Jfv8/f39/t/l7qmVZe3w9 ...

(a base64URL string was generated from the file in the image field Photo)

See also

loadFileAsBase64, which converts a file to base64 format.

shareFile, which returns an URL of a specific file.

Last updated