File Upload validation size before upload

Topics related to the standard LSPS process application.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
Posts: 58
Joined: Tue May 13, 2014 12:20 pm

File Upload validation size before upload

Mon Dec 01, 2014 11:09 pm

Is there a way to check on UI/client side the File Upload size before the file is uploaded? e.g. clicking the File Upload button, choosing a file, open, and maybe having a action-listener on the form that can validate the file to check it it is 1 MB or less? (and if it is larger, have the message in the validation to something like "File too large". - I know this is a binary file in LSPS, and I am not sure how to go about doing this in the expression language.
Thing is, when I go over the given column value, I get this error.
Capture.PNG (91 KiB) Viewed 4447 times

Caused by: org.hibernate.exception.DataException: Data truncation , Caused by: java.sql.DataTruncation: Data truncation

Which is saying it is being truncated from the file size being too large. This is exceeding the 1 MB, but if this could be handled on the UI, and validated before hand to not except a file bigger than 1 MB, this would at least stop the error message break. Any ideas on the best approach to handle this? - Thanks in advance

C. Tampitsikas
Posts: 30
Joined: Wed Oct 22, 2014 3:04 pm

Re: File Upload validation size before upload

Wed Dec 03, 2014 2:43 pm

Hi Eric,

Unfortunately in LSPS you can check the size of the file only after the upload.
There exists the FileUpload listener and you can write validation expressions there but this listener is consuming the FileUpload event that is produced after the upload has finished.

Our development team is currently working in possible solutions (i.e. usage of javascript) in order to obtain file information before the upload process.
I will come to you with a proposal ASAP


Posts: 58
Joined: Tue May 13, 2014 12:20 pm

Re: File Upload validation size before upload

Wed Dec 03, 2014 3:18 pm

Thanks for the response Charalampos!
- I do understand. Though it would be nice to have the ability to have a validation flag i.e. "The file size is too large" when the file is loaded into the File Upload box instead of a error message that disrupts the process. I thought there may have been a way to code this in, but was unsure exactly how to integrate it in. - So for now, I will leave it be. Again, thanks for your response, and I will be looking forward to hearing back from you and/or the dev team. :D

Return to Process application

Who is online

Users browsing this forum: No registered users and 1 guest