The Picker can be initialized with the following parameters.
Only the uploadKey
is mandatory, all other parameters are optional.
By default, the FileSpin widget will allow users to upload local device. Dropbox uploads require additional setup (see Dropbox Support below).
Parameter | Description |
---|---|
uploadKey | required , your uploadKey |
providers | Valid options are local , weburl , dropbox , googledrive , box , flickr , onedrive . To customize which providers to show, provide an array of valid values |
maxFilesize | The maximum file size to allow (in MB, can be a float, like 250.5 ). Default is 5000 (5 GB). |
minFilesize | The minimum file size to allow (in MB, can be a float, like 0.01 ). Default is 0.01 (10 KB). |
maxFiles | The maximum number of files allowed. Default is 100 . |
allowedTypes | An array of extensions allowed for upload. Example: ["jpg","png"] |
autoUpload | Default fals e. if set to true , once a file is selected in the picker for any provider it will trigger the upload immediately. |
maximizeOnOpen | Default is false . if set to true , picker modal will fill the viewing area |
display | If set to false , the picker is accessible only via its API, the dialog won't display. Default is true |
minimizeOnUpload | If set to true , when user clicks Upload, Picker will be minimized and placed at bottom-right of user window |
hideOnUpload | If set to true , when user clicks Upload, Picker is hidden immediately but uploads continue and events are fired as usual. Default is false |
hideAfterUpload | If set to true , the Picker is hidden once all uploads are completed. Default is false |
css | Provide headerColor and headerTextColor to control the Picker Window header colors |
lang | Sets the widget UI display language. Can be en , fr , de or es . If not set, defaults to the user browser's language where possible otherwise falls back to en (English). |
fileToReplaceId | Asset ID for file replace. Used when Picker is opened in Asset replace mode |
serviceToken | Used when Picker is opened in Asset replace mode. See Asset replace mode for more |
Dropbox Support
Please note that in order to use dropbox
provider you must provide your own App Key and App Secret for OAuth2 flow. You can create an app and get the App Key and Secret from Dropbox App Console. After obtaining the details from Dropbox, you can specify the Dropbox App Key and Secret in your FileSpin Account Authorization Settings.
Picker configuration with all options
Here is a sample initPicker
API with all available options set to their defaults (excluding Asset replace mode
).
//Initialize Picker with all available options
FileSpin.initPicker({
uploadKey: "UPLOAD_KEY",
lang: "en", //Picker Dialog language - en, fr, de, es, zh, ja
providers: ["local", "weburl", "flickr", "box", "onedrive", "googledrive"],
maxFilesize: 5000,
minFilesize: 0.01,
maxFiles: 100,
allowedTypes: ["jpg", "png", "gif", "mp4", "wav", "mp3"],
css: { headerColor: "#fff", headerTextColor: "#000" },
display: true,
maximizeOnOpen: true,
minimizeOnUpload: false,
hideOnUpload: false,
hideAfterUpload: false,
autoUpload: false,
});
Please visit the Developer Playground to try out and learn more about FileSpin Picker