There is often a need to limit the size of files that a user can upload to the server.
In this simple example, we’ll show you how to limit the size of a user-uploaded image to 2MB.
The user interface is shown below:
The user interface consists of the following elements:
File Uploader Button;
Text element (contains a message about exceeding the allowed file size);
Image.
You can use the "on Before Upload" handler of the "File Uploader Button" to set the file size limit, as shown below.
If the image is successfully uploaded to the server, we will display the image in the user interface.
If the allowed file size is exceeded, an error message is displayed in the user interface, an exception is thrown and the file is not uploaded to the server.
When the file is successfully uploaded to the server, the link to the image is passed to the “Image” element (via Source URL Logic) and we can see the picture in the user interface.
I just sent you via personal email the address to the page where it does not seem to be working. I thought it wouldn’t be that great and secure to include the app’s URL openly in the forum.
It’s not that hard, actually : press on the top-right yellow button labelled “Personnaliser ma photo”. Then you can upload an image. The logic tests for something over 200 kB, and should, as I understand it, block from being uploaded if oversize. However, I managed to put an image 1.7 MB in there. Hence my question.
I believe both might be linked. I do upload a file. But the logging shows Files is undefined. And although I applied the recipe provided by Roman in the initial post, the end result is that a larger file than the limit is sent through.
We were able to duplicate the problem. This is a regression. The problem is with property value retrieval for the File objects. For the reference purpose the internal ticket number is BKNDLSS-27920