Function: downloadByUrl()
ts
function downloadByUrl(Url, type?): void;Downloads a file from a URL by creating a temporary object URL and clicking a link with a download attribute.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
Url | string | undefined | The URL of the file to download. |
type | string | 'application/octet-stream' | The MIME type of the file. Defaults to 'application/octet-stream'. |
Returns
void
Example
ts
downloadByUrl('https://example.com/my-file.xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')Since
1.0.0