This is a migrated thread and some comments may be shown as answers.

shorten display names of multiple files?

3 Answers 65 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 21 Feb 2012, 08:20 PM

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

3 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 22 Feb 2012, 01:27 PM
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 >>
0
Steven
Top achievements
Rank 1
answered on 22 Feb 2012, 05:59 PM
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


0
Bozhidar
Telerik team
answered on 23 Feb 2012, 11:02 AM
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.
Tags
AsyncUpload
Asked by
Steven
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Steven
Top achievements
Rank 1
Share this question
or