The context object that provides access to the render
method.
The options to configure the file upload dialog.
A promise that resolves with an array of SdkFile
objects, or null
if the user cancels the dialog.
const options = {
fileUploadTitle: 'Upload Files',
uploadButton: 'Upload',
text: 'Please select file to upload.',
fileLimit: 3,
error: 'You can upload up to 3 files only.',
validate: async (file) => {
if (file.size > 1024 * 1024) {
return { isValid: false, message: 'File size exceeds 1MB.' };
}
return { isValid: true, message: '' };
},
};
const selectedFiles = await showUploadFile(context, options);
if (selectedFiles) {
// Process the selected files.
}
Generated using TypeDoc
Displays a file upload dialog and returns an array of
SdkFile
objects containing the selected files' data and metadata.