function GetFileSizetypeIMG() {
var maxsize=2*1024*1024//1mb=1*1024*1024
var aspFileUpload = document.getElementById("<%=Upload1.ClientID%>");
var filesze = aspFileUpload.files[0].size;
var fileName = aspFileUpload.value;
var ext = fileName.substr(fileName.lastIndexOf('.') + 1).toLowerCase();
if (!(ext == "zip")) {
alert("Invalid file type, must select a (*.zip) file");
return false;
}
if (filesze > maxsize) {
alert("Selected file not more than " + maxsize/(1024*1024)+"MB");
return false;
}
return false;
}
var maxsize=2*1024*1024//1mb=1*1024*1024
var aspFileUpload = document.getElementById("<%=Upload1.ClientID%>");
var filesze = aspFileUpload.files[0].size;
var fileName = aspFileUpload.value;
var ext = fileName.substr(fileName.lastIndexOf('.') + 1).toLowerCase();
if (!(ext == "zip")) {
alert("Invalid file type, must select a (*.zip) file");
return false;
}
if (filesze > maxsize) {
alert("Selected file not more than " + maxsize/(1024*1024)+"MB");
return false;
}
return false;
}
No comments:
Post a Comment