Uploaded File,Image Extension Show Using JQuery Asp.Net C#

Uploaded File or Image Extension Show


Image,File Extension Get During The Uploading Time  Display alert Message or Label  Using JQuery  Asp.Net C#.

                                DEMO





                     Download Coding

                                          Download

                        HTML CODING


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script lang="javascript">

        function GetExtension() {                  
            var Extension = $("#FileUpload1").val().split('.').pop();        
            if (Extension != '')
            {
                alert(Extension);
                var label = document.getElementById('<%=Label1.ClientID%>');
                label.innerHTML ="Extension= "+Extension;
            }           
        };         

    </script>
</head>
<body>
    <form runat="server">
    <div>        
       <asp:FileUpload ID="FileUpload1" runat="server" onchange="GetExtension()" />      
        <asp:Label ID="Label1" runat="server" ForeColor="#FF0066"></asp:Label>
    </div>
        </form>
</body>

</html>



First - Create - New Web Form - Add FileUpload Control & Label From ToolBox







Next - JQuery Script file Get the Extension of Uploaded file









0 comments:

Post a Comment