求助怎样实现客户端上传文件时再不提交上传时判断文件的大小
<SCRIPT>
function getFileSize (fileName) {
if (document.layers) {
if (navigator.javaEnabled()) {
var file = new java.io.File(fileName);
if (location.protocol.toLowerCase() != 'file: ')
netscape.security.PrivilegeManager.enablePrivilege(
'UniversalFileRead '
);
return file.length();
}
else return -1;
}
else if (document.all) {
window.oldOnError = window.onerror;
window.onerror = function (err) {
if (err.indexOf( 'utomation ') != -1) {
alert( 'file access not possible ');
return true;
}
else