Skip to content

Home > robinson > downloadByBase64

downloadByBase64() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

通过Base64编码的字符串下载文件

Signature:

typescript
declare function downloadByBase64(buf: string, fileNm: string, suffix: string): void;
declare function downloadByBase64(buf: string, fileNm: string, suffix: string): void;

Parameters

ParameterTypeDescription
bufstringBase64编码的字符串
fileNmstring下载后的文件名
suffixstring下载后的文件后缀

Returns:

void

Example

downloadByBase64('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...', 'example.png', 'png');

Released under the MIT License.