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

前端 未结 8 807
醉梦人生
醉梦人生 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:32

    Other that aquiring the filename there is no way for you to find out any other details about the file in javascript including its size.

    Instead you should configure server-side script to block an oversized upload.

提交回复
热议问题