MultiFile Upload
Last updated
Was this helpful?
Last updated
Was this helpful?
(part of package '') Extends designtime/SolutionModel: Extends runtime:
A Servoy Extra Component that supports multi-file upload functionality.
This is a reference page; many components have detailed usage guides .
Should not be used together with closeAfterFinish (so both properties to be true) Type: Default Value: true
By default the component will wait for an upload button to be pressed in the UI, or the upload() method to be called, before starting an upload. Setting this to autoProceed: true will start uploading automatically after the first file is selected. Type: Default Value: false
Whether to automatically close the modal when all current uploads are complete. If this is set, allowMultipleUploads and inline properties ahould be false. Type: Default Value: false
Whether to show upload progress and pause/resume/cancel buttons. Type: Default Value: false
Called before a file is added. Return true if the file should be accepted, or false otherwise.
Parameters:
Fired when a file is added.
Parameters:
Fired when a file is removed from the component.
Parameters:
Fired when a file is successfully uploaded.
Parameters:
Fired when the modal window is closed.
Fired when the modal window is opened.
Called when a file fails to meet the specified restrictions.
Parameters:
Fired when all file uploads are complete.
Parameters:
Cancel all uploads, reset progress and remove all files.
Close the modal window
Get a specific file object by its ID
Parameters:
Get an array of all file objects in the component
Sets a message in state, with optional details
Parameters:
(Re-)initializes the component
Open the modal window
Remove a file from the component
Parameters:
Stop all uploads in progress and clear file selection, set progress to 0. Basically, return things to the way they were before any user input.
Retry all uploads (after an error, for example)
Retry an upload (after an error, for example).
Parameters:
Start uploading selected files.
Represents a meta field used for additional file information. scripting type: CustomType<servoyextra-multifileupload.metaField>
id
Unique identifier for the meta field.
name
The name of the meta field.
placeholder
Placeholder text for the meta field.
Represents the progress information for a file upload. scripting type: CustomType<servoyextra-multifileupload.progress>
bytesTotal
Total number of bytes to be uploaded.
bytesUploaded
Number of bytes uploaded so far.
percentage
Upload progress percentage.
uploadComplete
Flag indicating whether the upload is complete.
uploadStarted
Timestamp indicating when the upload started.
Represents a file uploaded via the component. scripting type: CustomType<servoyextra-multifileupload.uploadFile>
error
Error message if the file upload failed.
extension
The file extension (e.g. 'jpg', 'png').
id
Unique identifier for the file.
metaFields
Meta data fields associated with the file.
name
The name of the file.
progress
The progress object representing the file upload progress.
type
The MIME type of the file.
Represents the restrictions for file uploads. scripting type: CustomType<servoyextra-multifileupload.uploadRestriction>
allowedFileTypes
An array of allowed file types (e.g. ['image/jpeg', 'image/png']).
maxFileSize
The maximum allowed file size in bytes.
Default Value: null
maxNumberOfFiles
The maximum number of files that can be selected.
Default Value: null
minNumberOfFiles
The minimum number of files that must be selected.
Default Value: null
Hide the upload button. Use this if you are providing a custom upload button somewhere, and using the upload() API. Type: Default Value: false
When false, the component does not show on the form, but in a modal that is shown when openModal() is called. Should not be used together with closeAfterFinish (so both properties to be true) Type: Default Value: true
One of the language packs shipped. If you need to provide your own translations, use the localeStrings property. Type: Default Value: null
Any number of key/value pairs to translate single strings in the component, overriding the ones provided by the language pack selected. Type:
An array of UI field objects that will be shown when a user clicks the 'edit' button on that file Type:
A note associated with the component. Type:
A map of additional options. Type:
Height (in pixels) to be set in a responsive form. Type: Default Value: 450
Width to be set in a responsive form. Can be a number (in pixels) or a percent. Type: Default Value: "290"
Provide rules and conditions to limit the type and/or number of files that can be selected. Type:
Allows to add additional sources of files (other than the user's file system) Type:
CSS style classes applied to the component. Type:
Look at the Uppy TUS options what you can set here like chunkSize: nrOfBytes Type:
Flag indicating whether the component is visible. Type: Default Value: true
Look at the Uppy webcam plugin options what you can set here like showVideoSourceDropdown Type: Default Value: {"target":"Dashboard","showVideoSourceDropdown":true}
{} fileToAdd The file object to be added
{} files The current array of file objects in the component
{} event The event object associated with the file addition
Returns: {}
{} fileAdded The file object that was added
{} event The event object associated with the addition
{} fileRemoved The file object that was removed
{} event The event object associated with the removal
{} jsUpload The upload object containing details about the uploaded file
{} event The event object associated with the upload
{} file The file object that failed the restrictions
{} error The error message describing why the restriction failed
{} event The event object associated with the restriction failure
{} successfulFiles The array of file objects that were uploaded successfully
{} failedFiles The array of file objects that failed to upload
{} event The event object associated with the upload completion
{} fileID The unique identifier of the file to retrieve.
Returns: The file object corresponding to the given file ID, or null if no such file exists.
Returns: An array of all file objects currently in the component.
{} message String, details: String}} message
{} [type] Info, warning, success or error (defaults to info)
{} [duration] The duration in milliseconds (defaults to 3000)
{} fileID The unique identifier of the file to be removed from the component.
{} fileID The unique identifier of the file to retry uploading.
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type:
Type: