Guides

Widget Configuration

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).

ParameterDescription
uploadKeyrequired , your uploadKey
providersValid options are local, weburl, dropbox, googledrive, box, flickr, onedrive. To customize which providers to show, provide an array of valid values
maxFilesizeThe maximum file size to allow (in MB, can be a float, like 250.5). Default is 5000 (5 GB).
minFilesizeThe minimum file size to allow (in MB, can be a float, like 0.01). Default is 0.01 (10 KB).
maxFilesThe maximum number of files allowed. Default is 100.
allowedTypesAn array of extensions allowed for upload. Example: ["jpg","png"]
autoUploadDefault false. if set to true, once a file is selected in the picker for any provider it will trigger the upload immediately.
maximizeOnOpenDefault is false. if set to true, picker modal will fill the viewing area
displayIf set to false, the picker is accessible only via its API, the dialog won't display. Default is true
minimizeOnUploadIf set to true, when user clicks Upload, Picker will be minimized and placed at bottom-right of user window
hideOnUploadIf set to true, when user clicks Upload, Picker is hidden immediately but uploads continue and events are fired as usual. Default is false
hideAfterUploadIf set to true, the Picker is hidden once all uploads are completed. Default is false
cssProvide headerColor and headerTextColor to control the Picker Window header colors
langSets 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).
fileToReplaceIdAsset ID for file replace. Used when Picker is opened in Asset replace mode
serviceTokenUsed 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