capacitor-chunk-upload
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

capacitor-chunk-upload

Chunk upload for iOS, Android, and web

Install

npm install capacitor-chunk-upload
npx cap sync

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>
Param Type
options { value: string; }

Returns: Promise<{ value: string; }>


uploadFile(...)

uploadFile(options: UploadOptions) => Promise<void>

Upload a file via chunk

Param Type
options UploadOptions

addListener('uploadStarted', ...)

addListener(eventName: 'uploadStarted', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listens for event: upload started

Param Type
eventName 'uploadStarted'
listenerFunc () => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


addListener('uploadProgressChanged', ...)

addListener(eventName: 'uploadProgressChanged', listenerFunc: (progress: { percentage: number; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listens for event: upload progress changed

Param Type
eventName 'uploadProgressChanged'
listenerFunc (progress: { percentage: number; }) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle


removeAllListeners()

removeAllListeners() => Promise<void>

Removes all listeners


Interfaces

UploadOptions

Upload option

Prop Type Description
url string The URL to upload to
blob Blob The file to upload. Only available on Web.
path string The path of the file to upload. Only available on Android and iOS.
headers { [key: string]: string; } Addition headers to send with the request

PluginListenerHandle

Prop Type
remove () => Promise<void>

Readme

Keywords

Package Sidebar

Install

npm i capacitor-chunk-upload

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

68 kB

Total Files

28

Last publish

Collaborators

  • sozoo-k5u