@eoscz/capacitor-plugin-native-file-downloader
v2.0.1
Published
Capacitor plugin for downloading files using native apis.
Downloads
45
Readme
capacitor-plugin-native-file-downloader
Capacitor plugin for downloading files using native apis. Currently available only on web and Android.
Install
npm install @eoscz/capacitor-plugin-native-file-downloader
npx cap sync
API
scheduleFileDownload(...)
scheduleFileDownload(options: ScheduleFileDownloadOptions) => Promise<ScheduleFileDownloadResult>
Schedule file to be downloaded. Returned Promise resolves when the download is scheduled (not when download completes).
| Param | Type |
| ------------- | ----------------------------------------------------------------------------------- |
| options
| ScheduleFileDownloadOptions |
Returns: Promise<ScheduleFileDownloadResult>
Interfaces
ScheduleFileDownloadResult
| Prop | Type | Description |
| ---------------- | ------------------- | ------------------------------------------------------ |
| downloadId
| string | The internal identifier of scheduled download process. |
ScheduleFileDownloadOptions
| Prop | Type | Description |
| -------------- | ------------------- | ----------------------------------------------------------------------------- |
| url
| string | Url of the file to be downloaded. e.g. https://example.com/downloads/file.pdf |
| fileName
| string | Name of the downloaded file (including extension). e.g. my-file.pdf |