function
getPhotoSize(obj){
photoExt=obj.value.substr(obj.value.lastIndexOf(
"."
)).toLowerCase();
if
(photoExt!=
'.jpg'
){
alert(
"请上传后缀名为jpg的照片!"
);
return
false
;
}
var
fileSize = 0;
var
isIE = /msie/i.test(navigator.userAgent) && !window.opera;
if
(isIE && !obj.files) {
var
filePath = obj.value;
var
fileSystem =
new
ActiveXObject(
"Scripting.FileSystemObject"
);
var
file = fileSystem.GetFile (filePath);
fileSize = file.Size;
}
else
{
fileSize = obj.files[0].size;
}
fileSize=Math.round(fileSize/1024*100)/100;
if
(fileSize>=10){
alert(
"照片最大尺寸为10KB,请重新上传!"
);
return
false
;
}
}