Upload file process - controls before upload

I have a process that allows users to upload a file, but I want to avoid too big files and set size limit.
I would like to control the size before lauching the real upload.
I looked in the docs, but could not find how to do this control. I just found to limit the number of files.
Any idea ?

I use the simple upload process, ie one upload button to choose the file, and one simple button lauching the upload function of the first button.

Yes but the file size limit can not be set, so no error appears if it is greater than the size limit I want!

Then your only option is again → HTML-Component or custom element.
You are forced to generate a file reader.

Search for…

  1. Blob: A binary large object, which can represent data that doesn’t necessarily fit into a traditional file format. Blobs are often used to represent raw data.
  2. File Object: Represents a file or a set of files. It contains information about the file, such as its name, size, type, and last modification date.
  3. File Input: An HTML input element of type file that allows users to choose files from their device.
  4. File API: A set of JavaScript APIs that allow web applications to interact with files. It includes the File, Blob, and FileReader interfaces.
  5. Data URL: A URL scheme that allows you to include data in-line in web pages as if they were external resources. Often used to represent the content of files, such as images or text files.
  6. File Reader: An interface provided by the File API that allows you to read the contents of a file asynchronously.
  7. Uploading: The process of transferring a file or data from a local device to a remote server.
  8. Base64 Encoding: A method to encode binary data (like images) as ASCII text. Often used in data URLs.
  9. MIME Type: A standard way of indicating the type of data contained in a file. It’s usually expressed as a two-part identifier, such as “image/png” for a PNG image.
  10. Binary Data: Data in a form composed of characters that are not human-readable. This is in contrast to text data.

Before starting your upload → you should be able to check the filze-size this way.
The upload-Button is still not completely functional.

I pushed a little bit further in the properties of the upload button and found that “valid” has a lot of information, among which the size I was looking for !!! Bingo !