可通过下面的方式 html代码:js代码:var fileId = "uploadtest";var dom = document.getElementById(fileId); var fileSize = dom.files[0].size;//文件的大小,单位为字节B