space-file-picker-first-test
v1.1.1
Published
This is a npm package to pick your files from your PodSpace storage.
Downloads
10
Maintainers
Readme
File Picker
Opens a Space file picker dialog upon being called.
Note: For security reasons, file-picker
must be triggered by an original DOM event (click
, touchstart
, keyup
, etc.). It cannot be called onload
or in a timeout.
Installation
$ npm install space-file-picker-first-test
Usage
import { SpacePicker } from "space-file-picker-first-test";
<SpacePicker
key={Math.random()}
open={dialogOpen}
handleClose={handleCloseDialog}
accessToken={accessToken}
keyId={keyId}
timestamp={timeStamp}
signature={signature}
uploadType={singleOrBatch}
canUpload={canUpload}
folderAllowed={folderAllowed}
onHandleHashes={onHandleHashes}
/>;
API
filePicker(opts, fn)
Valid options:
open
(Boolean) whether the user can select multiple fileshandleClose
(Function) Handles the closing stateaccessToken
(String)keyId
(String)timestamp
(String)signature
(String)uploadType
(String) can besingle
,batch
orno_choice
canUpload
(Boolean) whether the user can upload in the file pickerfolderAllowed
(Boolean) whether the user can select foldersonHandleHashes
(Function) the callback function to receive the selected hashed like this:function onHandleHashes(hashes: any[]) { ... }
Browser support
- Internet Explorer 9+
- Firefox
- Chrome
- Opera
- Safari
- Mobile Safari
- Android Browser