975
Views
5
Comments
How to check file size client side?

Hello Community,

I'm new to this OS world.

I want to upload file to the server but before uploading it to the server, I want to check it's size at client side.

If file size is more than 5 MB, I want to show error message like this.

I'm using upload file widget but not sure how do I implement javascript over there.

Can someone please advice?

Thanks and Regards,

Royal Naidu

2018-05-30 16-28-55
Gopinath Reddy Reddigari

Please check out this forge component. May be you can extend it to check even the size of file.

https://www.outsystems.com/forge/component-overview/3163/file-extension-validation-client-side

2020-03-01 17-52-33
Nikhil Gaur

Hi Royal,

You can use GetFileSize client action from this forge component if you are developing with reactive web or mobile app. It will return file size in bytes so do the conversion accordingly before comparing.

2021-09-10 14-03-53
Salman Ansari

Royal Naidu wrote:

Hello Community,

I'm new to this OS world.

I want to upload file to the server but before uploading it to the server, I want to check it's size at client side.

If file size is more than 5 MB, I want to show error message like this.

I'm using upload file widget but not sure how do I implement javascript over there.

Can someone please advice?

Thanks and Regards,

Royal Naidu

Hi Royal,


1.As above explain by Gopi you can use below extension in traditional app.

https://www.outsystems.com/forge/component-overview/3163/file-extension-validation-client-side


2.Below code will use for Reactive/Mobile App.

Please check the below example how we can do that 


2022-11-02 07-18-33
Nicholas Campbell

This gives an error that 'atob' does not exist?

2018-02-02 18-32-34
Yannick Rios

Hi Royal,

This is an old post but here is my answer. Here's a solution I implemented that achieves this:


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.