I am developing the web based application which require to check size of any file before uploading it on server.
It would have been easy if there was any means by which web developer can check size of file at client side instead of checking at server side which could avoid unnecessary trip to server.
Is there any security concern for not providing the file size validation in javascript?
In modern browsers there have been a lot of measures put in place to keep a (malicious) developer from determining anything about the user's filesystem. As a result there is little you can do in this respect in JavaScript.
There are several alternatives I can think of.
You're not going to get the information you're looking for using pure JavaScript without a roundtrip to the server.
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.