Expand|Select|Wrap|Line Numbers
- function imageSize (pathField, previewName)
- {
- var str = '';
- var path = pathField.value;
- document[previewName].src = 'file://'+path.replace(/\\/gi,'/');
- var img = new Image();
- img.src = 'file://'+path.replace(/\\/gi,'/');
- var size_pic = document.getElementById(previewName).fileSize;
- str = "File size="+size_pic;
- return (str);
- }
[HTML]<form name="myform" method="post" action="<myaction>">
<input name="upload_file" type="file" id="upload_file" size="28" value="" onChange="javascript:imageSize(document.myform.upl oad_file, 'tmpImg')"><br>
<img src="tmp.gif" name="tmpImg" width="1" height="1"/>
<input type="Submit" name="upload" value=”upload">
</form>[/HTML]
If I test my function offline it always manage correctly. Unfortunately, when I test it online (i.e. when I copy the html with the above javascript on my webserver Apache), it manages only if files I upload are little. Normally it returns -1!
Could someone help me to find the problem?