Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

File.size

概述

返回一个File对象所指代的文件的大小,单位为字节。

例子

// fileInput是一个HTMLInputElement元素: <input type="file" multiple id="myfileinput">
var fileInput = document.getElementById("myfileinput");
// files是一个FileList对象(类似于NodeList)
var files = fileInput.files;
for (var i = 0; i < files.length; i++)
{
    alert(files[i].name + "文件的大小为 " + files[i].size + " 字节");
}

文档标签和贡献者

 此页面的贡献者: icyflash, ziyunfei
 最后编辑者: icyflash,