I don't think that you can do that client-side in FireFox. This will work, locally:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function getImgSize(imgSrc, flag){
if(!flag){
var newImg = new Image();
imgSrc="file://localhost/"+imgSrc;
newImg.src =imgSrc;
}
else
var newImg = imgSrc
if (typeof newImg.complete=='boolean'&&(newImg.complete&&newImg.height*1>0)){
var height = newImg.height;
var width = newImg.width;
alert ('The image size is '+width+'*'+height);
}
else if (typeof newImg.complete=='boolean'){
alert('having trouble')
setTimeout(function(){getImgSize(newImg,'x')}, 3000);
}
else alert('Image cannot be evaluated for size');
}
</script>
</head>
<body>
<input type="file" onchange="getImgSize(this.value)">
</body>
</html>
But, when made live, FireFox simply will not load the client image. It will not even load it if it is hard coded into the page as the src attribute of an image tag, ex:
HTML Code:
<img src="file://localhost/c:/somedir/some.jpg">
What you are looking for is routinely done server-side. You should look into that.
Bookmarks