Skip to content

Function: downloadByBase64() ​

ts
function downloadByBase64(base64, filename): void;

Downloads a file from a base64 data URL or raw base64 string.

Parameters ​

ParameterTypeDescription
base64stringThe base64 string or data URL.
filenamestringThe filename for the downloaded file.

Returns ​

void

Example ​

ts
console.log('triggering download...')
downloadByBase64('data:image/png;base64,iVBORw0KGgo=', 'image.png')

Since ​

1.0.0

Released under the MIT License.