K
Ken
I would like to measure the fileSize of the image (without uploading it -
php).
I use:
var size_pic = document.getElementById('num1').childNodes[0].fileSize;
alert("size = " + size_pic);
which works on IE with one exception.
With a first time displayed image, the script displays a size= -1 The image
is displayed on the first pass. The fileSize script is located after the
img script.
var image_display=document.createElement('img');
image_display.src='file://' + field;
image_display.name = 'pict';
document.getElementById('num1').appendChild(image_display);
The second pass is correct. size = 11479
Is this a cache problem? The first pass caches the file, the second pass
reads the file?
I tried running - var size_pic
=document.getElementById('num1').childNodes[0].fileSize; - twice but that
made no difference.
Is there a work around for this problem.
Is there a better way to measure filesize in JavaScript?
Have a good day!
Ken
php).
I use:
var size_pic = document.getElementById('num1').childNodes[0].fileSize;
alert("size = " + size_pic);
which works on IE with one exception.
With a first time displayed image, the script displays a size= -1 The image
is displayed on the first pass. The fileSize script is located after the
img script.
var image_display=document.createElement('img');
image_display.src='file://' + field;
image_display.name = 'pict';
document.getElementById('num1').appendChild(image_display);
The second pass is correct. size = 11479
Is this a cache problem? The first pass caches the file, the second pass
reads the file?
I tried running - var size_pic
=document.getElementById('num1').childNodes[0].fileSize; - twice but that
made no difference.
Is there a work around for this problem.
Is there a better way to measure filesize in JavaScript?
Have a good day!
Ken