代码如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>上传文件</title>
</head>
<script type="text/javascript">
function upload(){
var upload_file = document.getElementById("id_file").files;
//上次修改时间
alert("文件名:"+upload_file[0].name+
"\n上次修改时间:"+upload_file[0].lastModifiedDate+
"\n文件长度:"+upload_file[0].size+
"\n文件类型:"+upload_file[0].type);
}
</script>
<body>
<form id="id_form" runat="server">
<div>
<input type="file" name="name_file" id="id_file" />
<input type="button" id="id_upload" value="上传" onclick="upload()"/>
</div>
</form>
</body>
</html>