简体   繁体   中英

How to put file upload limit in gwt client side?

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

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

You can do that using W3C Files API . There is a GWT wrapper for it at http://www.vectomatic.org/libs/lib-gwt-file .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM