Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get serverside renaming filename in clientside while using AsyncFileUpload
    primarykey
    data
    text
    <p>server sidecode</p> <pre><code>protected void UploadComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { rlativepath =GeneratePrefixFileName() + AsyncFileUpload1.PostedFile.FileName; databasepath = "~/Image/" + rlativepath; filePath = Request.PhysicalApplicationPath + "image\\"+rlativepath; AsyncFileUpload1.SaveAs(filePath); } </code></pre> <p>client side code</p> <pre><code>&lt;script type="text/javascript"&gt; function upLoadStarted() { $get("imgDisplay").style.display = "none"; } function showConfirmation(sender, args) { var txt = document.getElementById('&lt;%=statusoutput.ClientID %&gt;'); var img = document.getElementById('&lt;%=statusoutput.ClientID %&gt;'); txt.value = "Upload Successful"; var imgDisplay = $get("imgDisplay"); imgDisplay.src = "ajaxupload.jpg"; imgDisplay.style.cssText = "height:100px;width:100px"; var img = new Image(); img.onload = function () { imgDisplay.style.cssText = "height:100px;width:100px"; imgDisplay.src = img.src; }; &lt;%# UploadFolderPath1+=rlativepath %&gt; img.src = "&lt;%=ResolveUrl(UploadFolderPath1) %&gt;"+ args.get_fileName(); alert(img.src); var imagedescrip = $get("imagedescrip"); imagedescrip.style.cssText = "visibility:visible;"; } </code></pre> <p> aspx page:</p> <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt; &lt;/asp:ScriptManager&gt; content of page FNever increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349) &lt;asp:AsyncFileUpload ID="AsyncFileUpload1" runat="server" OnUploadedComplete="UploadComplete" ThrobberID="imgLoader" OnClientUploadStarted="upLoadStarted" UploaderStyle="Modern" OnClientUploadComplete="showConfirmation" Width="400px" CompleteBackColor="White" UploadingBackColor="#CCFFFF"&gt;&lt;/asp:AsyncFileUpload&gt; &lt;input type="text" id="statusoutput" runat="server" readonly="readonly" tabindex="-1000" style="border:0px;background-color:transparent;" /&gt; &lt;asp:Image ID="imgLoader" runat="server" ImageUrl="ajaxupload.jpg" Height="100px" Width="100px" /&gt; &lt;img id = "imgDisplay" alt="" src="" style = "display:none;height:100px;width:100px"/&gt; </code></pre> <p>I'm using AsyncFileUpload for uploading files, before saving file on server, i rename the selected file. How can I get this new file name in the client side? now my problem is i am not getting the renaming filename with args.get_filename() in client side.how to get it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload