js客户端处理上传图片大小的验证 问题描述:现在想上传一图片,并且想在客户端判断一下图片的大小是否满足要求,不想通过已经上传至服务器再取文件大小来判断,有好方法么?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 js好像不能获取客户端的图片信息除非你用active或者flash <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>cc</title></head><body><form method="post" name="myform1" enctype="multipart/form-data" > <input type="file" name="file1" size="20" onchange="func()"/></form><script>function func(){ var oImg=new Image(); oImg.src=myform1.file1.value; alert("width:"+oImg.width+"\nheight:"+oImg.height+"\nfilesize:"+(oImg.fileSize/1024).toFixed(1)+"k");}</script></table> </body></html> 求助,js代码同一页面不能调用两次. 值生效的问题 如何解决穿层现象! window.event ff问题,急 求教:IE7.0 web 后退时,javascript 不可用问题 JQuery CheckBox勾选状态在clone()时保持问题 IE8失效 为什么样式总是不对呢? Highcharts 数据json该怎么定义 extjs, xtype: 'filefield', 好问题 一个简单的问题:表格列宽的设定?? 用javscript做一个类似chm帮助文档的HTML jsp页面和ASP做页面那个好
除非你用active或者flash
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>cc</title>
</head><body><form method="post" name="myform1" enctype="multipart/form-data" >
<input type="file" name="file1" size="20" onchange="func()"/></form>
<script>
function func()
{
var oImg=new Image();
oImg.src=myform1.file1.value;
alert("width:"+oImg.width+"\nheight:"+oImg.height+"\nfilesize:"+(oImg.fileSize/1024).toFixed(1)+"k");
}
</script>
</table>
</body></html>