Javascript check file size

前端 未结 4 1634
时光取名叫无心
时光取名叫无心 2021-01-12 22:33

Is it possible to keep checking with javascript if the filesize of a file on a webserver (e.g. http://www.mysite.com/myfile.js) is larger than 0 bytes and if so return a tru

4条回答
  •  臣服心动
    2021-01-12 23:13

    IE: If you set the Ie 'Document Mode' to 'Standards' you can use the simple javascript 'size' method to get the uploaded file's size.

    Set the Ie 'Document Mode' to 'Standards':

    
    

    Than, use the 'size' javascript method to get the uploaded file's size:

    
    

    Other browsers: On all the other browsers you can use the javascript 'size' method without any problems.

提交回复
热议问题