Recommended way to check file size on upload

前端 未结 10 782
南笙
南笙 2021-02-04 10:33

I am working on a web application which supports file uploading. I am already familiar checking the size in server side, but i wanted to check the file size in a client side.

10条回答
  •  日久生厌
    2021-02-04 11:19

    In IE, you can do it with JS and ActiveX:

    function A()
    {
      var oas = new ActiveXObject("Scripting.FileSystemObject");
      var d = document.a.b.value;
      var e = oas.getFile(d);
      var f = e.size;
      alert(f + " bytes");
    }
    
    
    
    
    

提交回复
热议问题