If an application has two screens, where one screen A containing a FilePond widget with MaxFileSizeMB <> 0, and another screen where MaxFileSizeMB = 0 (i.e. unlimited file size), then sometimes users will get the following message when trying to upload a file in the second screen:
The issue is that, when a user navigates to the first screen, the file size validation plugin will be loaded. When the user navigates to the second screen, the plugin is already loaded, and will validate the file size.
If the user navigates directly to the second screen, the file size validation plugin is not loaded, and the widget works as expected.
We have identified that, when the plugin is already loaded, and a FilePond widget is created with MaxFileSizeMB = 0, the maxFileSize parameter that is used by the plugin is initialized with an undefined value, and the plugin expects a null (instead of undefined) to disable the file size limits.
Hi, Leo.
The attached file have the modified OML of the last version of the component, with the FilePondUploadPlugin modified to handle this bug to contribute with this component update.
It can be seen at the line 469 of the filePondUploadPlugin script.
I've attached a demo showing the component working without this bug too,
Thanks Leonardo, great scenario.
Thanks Guilherme for finding a solution.
Could you confirm if Guilherme's solution works, and I will put on the worklist applying Guilherme's fix.
Otherwise the work around is to specify max file size for both. For the one that is meant to be unlimited, set a very large max file size.
As a security mechanism, any production file upload really should be setting the max file size to avoid denial of service attacks. However, I am not aware of your requirements.
Another option for fixing is simpler, which is to make setting of a maximum file size mandatory. But I will look at Guilherme's fix first.
Kind regards,
Stuart
Hi Stuart. Guilherme works in the same team with me, so his solution is what we applied on the customer.
You're right about always seeing a max value, however it will be hard to come up with a hard limit and it would be a change request instead of a bug. So we don't want to make such a change if possible.
Hi Leonardo,
Yes, fair enough, thanks for explaining.
Seeing as how you have deployed your fix, I hope you don't mind if I take a few weeks to make the update. I have a few items on the list at the moment. However, I can always have my arm twisted to increase the priority (just ask my daughter!).
I have just now got around to looking at this.
Unfortunately, I am unable to open the oml file. I sent it through IPP first of course. I wonder if the platform it was downloaded from is a bit older?
Would it be possible to provide the updated line or lines of code; from the comments it looks like it is just one or two lines?
Thanks and kind regards,
Actually, please disregard the last one. I've used your (awesome) explanation to create a test and worked it out.
Thanks, I'll release a new version shortly!
Hello Guilherme and Leonardo,
Just for completeness, a fix for this was release in version 1.3.5.
Thanks again for your help with this issue.