shorten display names of multiple files?

4 posts, 0 answers
  1. Steven
    Steven avatar
    32 posts
    Member since:
    Jul 2012

    Posted 21 Feb 2012 Link to this post

    http://www.telerik.com/community/forums/aspnet-ajax/async-upload/shorten-display-name.aspx

    you guys offered a solution for shortening one filename in the above thread using the OnClientFileSelect event
    Is there something that will do the same thing for multiple files?  OnClientFilesSelected

    So if a user selects multiple files with long names, I can display

    veryveryverylong... [x remove]
    anotheryverylong... [x remove]

    I tried to get some documentation from http://www.telerik.com/help/aspnet-ajax/asyncupload-onclientfilesselected.html to figure it out but there isn't much info here. Are there other sources of info for these events?

    thanks...Steve

  2. Bozhidar
    Admin
    Bozhidar avatar
    1188 posts

    Posted 22 Feb 2012 Link to this post

    Hello Steven,

    The OnClientFileSelected event fires once for each file that you upload, even when you upload multiple files at once. So the solution from the forum works regardless of whether you select one or more files.
     
    Regards,
    Bozhidar
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. Steven
    Steven avatar
    32 posts
    Member since:
    Jul 2012

    Posted 22 Feb 2012 Link to this post

    It does work but I guess I forgot to mention the problem we were having.

    All the displayed file names of the uploaded files are being shown with the first shortened file name. But when we click submit, the correct files are uploaded.

    So, If i select 5 long files at once,
    One_LongLongLongFileName.pdf
    Two_LongLongLongFileName.pdf
    Thr_LongLongLongFileName.pdf
    Fou_LongLongLongFileName.pdf
    Fiv_LongLongLongFileName.pdf

    when they are listed they are shown as

    One_LongLong....   x remove
    One_LongLong....   x remove
    One_LongLong....   x remove
    One_LongLong....   x remove
    One_LongLong....   x remove

    thanks


  4. Bozhidar
    Admin
    Bozhidar avatar
    1188 posts

    Posted 23 Feb 2012 Link to this post

    Hello Steven,

    There was a small mistake in the example. The following line:
    var $span = $telerik.$(".ruUploadProgress", sender.get_element());
    should be:
    var $span = $telerik.$(".ruUploadProgress", args.get_row());

    The code in the forum has been fixed, and should now be working correctly.
     
    Greetings,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top