Reputation: 103
I want to make validation not to upload a file more than 100 MB in my file up loader widget. Currently I am uploading the file and transferring it on server side and there on server side checking the size. Is there any way so that I can check the file size on client side itself so that it will reduce the time required for file transfer to server side
Upvotes: 1
Views: 1581
Reputation: 2621
You can do that using W3C Files API. There is a GWT wrapper for it at http://www.vectomatic.org/libs/lib-gwt-file.
Upvotes: 0
Reputation: 122026
You can't, because javascript
doesn't provide any way to read the contents of a file
that is stored locally.
You have to do it on server side. And its always a better option to validate on server side
Upvotes: 2