File.name

概述

返回文件的名称.由于安全原因,返回的值并不包含文件路径.

示例

// fileInput is a HTMLInputElement: <input type="file" multiple id="myfileinput">
var fileInput = document.getElementById("myfileinput");

// files is a FileList object (simliar to NodeList)
var files = fileInput.files;

for (var i = 0; i < files.length; i++) {
  alert("Filename " + files[i].name);
}

文档标签和贡献者

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