How can I get a file's upload size using simple Javascript?

前端 未结 8 741
醉梦人生
醉梦人生 2020-12-10 04:41

I have upload file functionality on one of the page. I check for the extension of the file using JavaScript. Now i want to restrict the user from uploading file greater than

相关标签:
8条回答
  • 2020-12-10 05:42

    not possible. would be a major security concern to allow client side scripts to run that can read file info from and end users hard drive.

    0 讨论(0)
  • Most of these answers are way out-of-date. It is currently possible to determine file size client-side in any browser that supports the File API. This includes, pretty much, all browsers other than IE9 and older.

    0 讨论(0)
提交回复
热议问题