AsyncFileUpload - Rename file when save in server in asp.net ajax

Ajax AsyncFileUpload - How to rename file when save in server
AsyncFileUploadRenameFile.aspx

<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.IO" %>

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

<!DOCTYPE html>
<script runat="server">
    protected void AsyncFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
    {
        if(AsyncFileUpload1.HasFile)
        {
            string uploadFolder = Request.PhysicalApplicationPath + "Upload\\";
            string extension = Path.GetExtension(AsyncFileUpload1.PostedFile.FileName);
            AsyncFileUpload1.SaveAs(uploadFolder+"Test"+extension);
        }
    }    
</script>
<script type="text/javascript">
    function showConfirmation(sender,args) {
        document.getElementById('Label1').innerText = 'upload complete.';
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Ajax AsyncFileUpload - How to rename file when save in server</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:RoyalBlue; font-style:italic;">Ajax AsyncFileUpload Example: How To Rename File</h2>
        <hr width="525" align="left" color="SkyBlue" />
        <asp:ScriptManager 
            ID="ScriptManager1"
            runat="server"
            >
        </asp:ScriptManager>
        <br />
        <asp:Label 
            ID="Label1"
            runat="server"
            Font-Names="Comic Sans MS"
            ForeColor="OrangeRed"
            Font-Size="X-Large"
            Font-Italic="false"
            Font-Bold="true"
            >
        </asp:Label>
        <br /><br />
        <cc1:AsyncFileUpload 
            ID="AsyncFileUpload1" 
            runat="server" 
            OnUploadedComplete="AsyncFileUpload1_UploadComplete"
            OnClientUploadComplete="showConfirmation"
            CompleteBackColor="PaleGoldenrod"
            UploaderStyle="Traditional"
            BackColor="Gold"
            />
    </div>
    </form>
</body>
</html>
Related asp.net ajax examples