Data Types

Upload Widget: Configuration

This configuration object can be passed to the uploader.open(...) method, or to the options parameter on our framework components.

For example:

const uploader = Uploader({ apiKey: "free" }); // Replace "free" with your API key.
// Example 1: without a framework
uploader.open({ maxFileCount: 1 });
// Example 2: with a framework ('react-uploader' in this case)
<UploadDropzone uploader={uploader} options={{ maxFileCount: 1 }} />

All fields are optional:

{
"editor": {
"images": {
"crop": true,
"cropRatio": 1,
"cropShape": "circ"
}
},
"layout": "modal",
"maxFileCount": 1,
"maxFileSizeBytes": 10485760,
"metadata": {
"myCustomField1": true,
"myCustomField2": {
"hello": "world"
},
"anotherCustomField": 42
},
"mimeTypes": [
"image/jpeg"
],
"multi": false,
"onUpdate": Function,
"onValidate": Function,
"path": {
"fileName": "image.jpg",
"fileNameVariablesEnabled": true,
"folderPath": "/uploads",
"folderPathVariablesEnabled": true
},
"showFinishButton": true,
"showRemoveButton": true,
"styles": {
"colors": {
"active": "#528fff",
"primary": "#377dff"
},
"fontSizes": {
"base": 16
}
},
"tags": [
"images/profile"
]
}

Tip: to remove the image cropper set crop: false

See details: UploadWidgetConfig

Was this section helpful? Yes No

You are using an outdated browser.

This website requires a modern web browser -- the latest versions of these browsers are supported: