AsyncFileUpload - How to save uploaded file in asp.net ajax

Ajax AsyncFileUpload SaveAs() - How to save uploaded file
AsyncFileUploadSaveAs.aspx

<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html>

<script runat="server">
    protected void UploadComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
    {
        string filePath = Request.PhysicalApplicationPath+ "Image\\" + AsyncFileUpload1.PostedFile.FileName;
        AsyncFileUpload1.SaveAs(filePath);
    }    
</script>

<script type="text/javascript">
    function showConfirmation() {
        document.getElementById('Label1').innerText = 'file upload complete.';
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Ajax AsyncFileUpload SaveAs() - How to save uploaded file</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:SeaGreen; font-style:italic;">Ajax AsyncFileUpload Example: How To Use SaveAs()</h2>
        <hr width="500" align="left" color="Green" />
        <asp:ScriptManager 
            ID="ScriptManager1"
            runat="server"
            >
        </asp:ScriptManager>
        <br />
        <cc1:AsyncFileUpload 
            ID="AsyncFileUpload1" 
            runat="server" 
            OnUploadedComplete="UploadComplete"
            OnClientUploadComplete="showConfirmation"
            BackColor="HotPink"
            />
        <br />            
        <asp:Label 
             ID="Label1" 
             runat="server"
             Font-Size="Large"
             Font-Bold="true"
             ForeColor="Orange"
             >
        </asp:Label>           
    </div>
    </form>
</body>
</html>
More asp.net ajax examples