1.1.1 • Published 2 years ago
space-file-picker-first-test v1.1.1
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-testUsage
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,batchorno_choicecanUpload(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