Explanation
You can set limits on the number of files to be uploaded, individual size, and total size.
If no setting is made, no restriction is made by default. (Does not mean unlimited size upload support.)
var dx = dx5.get("component-id");
// Returning the number of files allowed. If there is no limit, -1 is returned.
var maxCount = dx.getMaxFileCount();
// Setting up to allow a total of 5 files, excluding virtual files.
dx.setMaxFileCount(5, false);
// Returning the size of the entire files that is allowed. If there is no limit, -1 is returned.
var maxTotalSize = dx.getMaxTotalSize();
// Setting the total size of the allowed files to 100MB, excluding virtual files.
dx.setMaxTotalSize(104857600, false);
// Returning the maximum size of individual files. If there is no limit, -1 is returned.
var maxSize = dx.getMaxFileSize();
// Setting the maximum size of individual files to 10MB.
dx.setMaxFileSize(10485760);
// Returning the minimum size of individual files. If there is no limit, -1 is returned.
var minSize = dx.getMinFileSize();
// Setting the minimum size of individual files to 1MB.
dx.setMinFileSize(1048576);
Example
|
You can limit the total number of files. If the value is -1, no restriction is made.
|
|
You can limit the size of the entire file. If the value is -1, no restriction is made.
|
|
You can limit the maximum of individual file sizes. If the value is -1, no restriction is made.
|
|
You can limit the minimum value of individual file sizes. If the value is -1, no restriction is made.
|