我对输入简单javescript |文件对象:javascript为什么我无法从文件数组中获取文件的名称?
var upfiles=new Array();
function addfile(files){
upfiles.push(files);
alert(upfiles[0].name); //undefined
alert(files[0].name); //can get file name
upfiles[0].prop("name"); //can get file name
alert(upfiles.length); //1
}
我不知道为什么upfiles[0].name
只给我返回undefined,而upfiles[i]).prop("name")
工作。两种方法的区别?
因为'upfiles'是一个数组数组 – freakish
在这里放置文件的结构,但是,它看起来像文件是数组文件 –