What is the correct syntax for fileSize in Mozilla?
This works in IE but not in Mozilla:
<input type=file size=65 name="picture1" onChange="image _size(this.valu e);"
Id="pt111">
<div id="image_size_ display"></div>
<script type="text/javascript">
// Image size to be under max limit
function image_size(fiel d){
if ((document.crea teElement) && (document.getEl ementById)) {
var image_display=d ocument.createE lement('img');
image_display.o nload = function() {
im_size = image_display.f ileSize;
}
image_display.s rc='file://' + field;
image_display.n ame = 'pict';
image_display.a lt = 'image';
document.getEle mentById('image _size_display') .appendChild(im age_display);
alert("im_size = " + im_size);
if(im_size >2000000){alert ("This picture ( file ) is geater than
2,000,000.\n\n" + "Select another picture or reduce the size of the picture
( file )")};
} }
</script>
Thanks.
Ken
This works in IE but not in Mozilla:
<input type=file size=65 name="picture1" onChange="image _size(this.valu e);"
Id="pt111">
<div id="image_size_ display"></div>
<script type="text/javascript">
// Image size to be under max limit
function image_size(fiel d){
if ((document.crea teElement) && (document.getEl ementById)) {
var image_display=d ocument.createE lement('img');
image_display.o nload = function() {
im_size = image_display.f ileSize;
}
image_display.s rc='file://' + field;
image_display.n ame = 'pict';
image_display.a lt = 'image';
document.getEle mentById('image _size_display') .appendChild(im age_display);
alert("im_size = " + im_size);
if(im_size >2000000){alert ("This picture ( file ) is geater than
2,000,000.\n\n" + "Select another picture or reduce the size of the picture
( file )")};
} }
</script>
Thanks.
Ken
Comment