图片上传数据库,上传的时候如何限制图片的大小(长、宽) 限制文件量是可以的,图片显示的时候你可以约束他的尺寸 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 兄弟我也关心这个问题。给你点心得吧给分啊<SCRIPT language=javascript>function index_image_valid(){ var img=new Image(); img.src=document.pho_up.pho_index.value; imagewidth=img.width; imageheigth=img.height; fsize=img.fileSize/1024; fsize=fsize.toFixed(1); document.pho_up.cmd.disabled=true; if(img.readyState!="complete") window.setTimeout("index_image_valid()",10); else {alert ("宽:"+imagewidth+"\n高:"+imageheigth+"\n大小:"+fsize+" KB"); document.pho_up.cmd.disabled=false}}</script></head><form name="pho_up" method="post" enctype="multipart/form-data"><input type="file" name="pho_index" size="20"><input type=button name="cmd" value="测试图片大小" onclick="index_image_valid();"> </form> extjs Ext.grid.GridPanel加载数据中如何将loading 的效果去掉 Ext里面的Label问题 这里的两个循环是不是互不相干的? js验证问题 如何实现表单里各项的值互相传递? 我现在已经用javasript 实现了一棵树状的结构,我想继续用javasript 来实现选中一个父节点的checkbox,同时它会选中该节点所有子节点checkbox? 点击打开链接的同时如何记录访问量? 一段奇怪的翻页代码 请大侠们帮忙看看,小弟有个显示时间的问题老搞不懂~ js进度条怎么监听url跳转的加载进度 有关iframe的问题!急 求一正则:替换掉网址
function index_image_valid(){
var img=new Image();
img.src=document.pho_up.pho_index.value;
imagewidth=img.width;
imageheigth=img.height;
fsize=img.fileSize/1024;
fsize=fsize.toFixed(1);
document.pho_up.cmd.disabled=true;
if(img.readyState!="complete")
window.setTimeout("index_image_valid()",10);
else
{alert ("宽:"+imagewidth+"\n高:"+imageheigth+"\n大小:"+fsize+" KB");
document.pho_up.cmd.disabled=false}
}
</script>
</head>
<form name="pho_up" method="post" enctype="multipart/form-data">
<input type="file" name="pho_index" size="20">
<input type=button name="cmd" value="测试图片大小" onclick="index_image_valid();">
</form>