@jakguru/vueprint / @jakguru/vueprint/utilities/files
Module: @jakguru/vueprint/utilities/files
Classes
Interfaces
Functions
showOpenFilePicker
▸ showOpenFilePicker(options?
): Promise
<FileSystemFileHandle
[]>
The showOpenFilePicker() method shows a file picker that allows a user to select a file or multiple files and returns a handle for the file(s). This function polyfills the missing functionality if the browser does not support window.showOpenFilePicker()
natively.
Parameters
Name | Type | Description |
---|---|---|
options? | FilePickerOptions | The options for the file picker |
Returns
Promise
<FileSystemFileHandle
[]>
A Promise that resolves with an array of FileSystemFileHandle objects
See
https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker
Defined in
showSaveFilePicker
▸ showSaveFilePicker(options?
): Promise
<FileSystemFileHandle
| { getFile
: () => Promise
<Blob
> ; kind
: string
= 'file'; name
: string
= opts.suggestedName; createWritable
: () => Promise
<{ close
: () => Promise
<void
> ; write
: (content
: any
) => Promise
<void
> }> }>
The showSaveFilePicker() method shows a file picker that allows a user to save a file either by selecting an existing file or entering a name for a new file. This function polyfills the missing functionality if the browser does not support window.showSaveFilePicker()
natively.
Parameters
Name | Type | Description |
---|---|---|
options? | SaveFilePickerOptions | The options for the file picker |
Returns
Promise
<FileSystemFileHandle
| { getFile
: () => Promise
<Blob
> ; kind
: string
= 'file'; name
: string
= opts.suggestedName; createWritable
: () => Promise
<{ close
: () => Promise
<void
> ; write
: (content
: any
) => Promise
<void
> }> }>
A Promise that resolves with a FileSystemFileHandle object that includes a getFile() method to retrieve the Blob.
See
https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker