正文 1089字数 136,655阅读

<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> </head> <body> <form id="form1" runat="server"> <div> <input type="file" name="f" id="f" /> <input type="button" name="aa" id="aa" value="测试" onclick="javascript: _s();" /> </div> </form> </body> </html> <script type="text/javascript"> function _s() { var f = document.getElementById("f").files; //上次修改时间 alert(f[0].lastModifiedDate); //名称 alert(f[0].name); //大小 字节 alert(f[0].size); //类型 alert(f[0].type); } </script>
Run code
Cut to clipboard

    *多个文件会存储在files数组中