Long file name for RadAsyncUpload

7 posts, 0 answers
  1. Veeresh
    Veeresh avatar
    2 posts
    Member since:
    Jun 2012

    Posted 06 Jun 2013 Link to this post

    Hi telerik,

    I have a file which is having long file name, when i upload file in RadAsyncUpload the file name is looking too strange.

    please help me to solve this.

    thanks in advance.

    Veeresh
  2. sri
    sri avatar
    1 posts
    Member since:
    Jul 2012

    Posted 11 Jun 2013 Link to this post

    Hi,
    I have similar problem.Is there any way to wrap test and display complete filename in the tooltip?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Jun 2013 Link to this post

    Hi,

    Try the following javascript to achieve your scenario.

    ASPX:
    <telerik:RadAsyncUpload OnClientFileUploaded="fileSelected" ID="RadAsyncUpload1" runat="server">
    </telerik:RadAsyncUpload>
    <telerik:RadToolTip runat="server" ID="tooltip1" TargetControlID="ClientID" IsClientID="true">
    </telerik:RadToolTip>

    JS:
    function fileSelected(sender, args)
     {
        var $span = $telerik.$(".ruUploadProgress", args.get_row());
        var name = $span.text();
        if (name.length > 15)
        {
            var newString = name.substring(0, 15) + '...';
            $span.text(newString);
        }
          // to add tooltip
        var radToolTip = $find("<%= tooltip1.ClientID %>");
        var RadAsyncUpload1 = $find("<%=RadAsyncUpload1.ClientID%>");
        radToolTip.set_targetControlID("RadAsyncUpload1");
        radToolTip.set_text(name);
    }

    Thanks,
    Shinu.
  5. Wired_Nerve
    Wired_Nerve avatar
    163 posts
    Member since:
    Oct 2007

    Posted 25 Oct 2013 Link to this post

    Great solution.. thanks
  6. Sameer
    Sameer avatar
    20 posts
    Member since:
    Apr 2013

    Posted 30 Oct 2013 Link to this post

    Hello Shinu, in my case the issue is something different. When I upload a file with a very lengthy name, the file is shown with red marker as if I have uploaded an invalid file. This happens in Firefox 23 and not in IE. Why?
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 30 Oct 2013 Link to this post

    Hi Sameer,

    Such an issue happens in older versions of Firefox when you try to upload files with lengthy file names using the File Api Upload module. As a temporary solution, try the following JavaScript.

    JavaScript:
    <script type="text/javascript">
        Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable = function () { return false; }
    </script>

    Thanks,
    Shinu.
  8. Sameer
    Sameer avatar
    20 posts
    Member since:
    Apr 2013

    Posted 30 Oct 2013 Link to this post

    Thanks shinu. It worked great.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017