<input type="file" id="hmFile" runat="server" />
$("#<%=hmFile.ClientID%>").live("change", function (e) {
var filename = document.getElementById("<%=hmFile.ClientID%>").value;
var exn = "";
var i = filename.lastIndexOf('.');
if (i !== -1) {
exn = filename.slice(i + 1);
}
if (exn !== "") {
if (CheckValidFile(exn)) { //CheckValidFile() function check whether the selected file is valid
//Bind selected image with control from server side
// __doPostBack("", document.getElementById("<%=hidImageID.ClientID%>").value);
// Or use ajax
}
else {
alert("Unable to process this photo. Please check your photo's format and try again.\n We support these photo formats: JPG, JPEG, GIF, PNG, and BMP");
}
}
});
Thanks & Regards
Solimon Joseph
Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator