日期:2014-05-16 浏览次数:20363 次
var sizealert = 0;
var sizelimit;
//检测ServiceMethod返回值
function ieCallBack(response) {
if (response == "invalid") {
sizealert = MessageSize.Bad;
}
else {
sizealert = MessageSize.Good;
}
}
//Check File Size
function checkFileSize(obj) {
sizelimit = document.getElementById('<%=txtSizeLimit.ClientID %>');
var Sys = {};
if (navigator.userAgent.indexOf("MSIE") > 0) {
Sys.ie = true;
}
if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
Sys.firefox = true;
}
var fsize = 0;
if (Sys.firefox) {
fsize = obj.files[0].size;
if (fsize > sizelimit.value) {
sizealert = MessageSize.Bad;
}
else {
sizealert = MessageSize.Good;
}
} else if (Sys.ie) {
var filePath = obj.value;
PageMethods.ValidateFileSize(filePath, sizelimit.value, ieCallBack);<