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

[Solved] Max files allowed to upload

1 Answer 103 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
CD
Top achievements
Rank 1
CD asked on 09 Mar 2012, 06:13 AM
The upload control has allow multiple, true or false. Is there a way to set a max files allowed when set to multiple? For example, set to multiple but only allow 3 files to be selected for upload? 
Also, we need to be able to also save a description of the file as well as the filename to a db for each file selected. Is there a way to handle this easier than what I've done before which was to allow only one file to up.load at a time, disallow automatically saving, have a separate textbox for additional info and then post to the controller. In the controller the file.saveas is called, if successfully saved, then run a second command to save the additional info and filename to a db. This kind of solution is fairly difficult when allowing multiple file selection. Any ideas?

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 12 Mar 2012, 10:27 AM
Hi,

One option for limiting the number of uploaded files is to keep a count through the client-side events. This can be a bit tedious though.

Since you also want to add a description I suggest you to take a look at the Upload in Grid code library. You should be able to add a limit for the number files with relative ease.

I hope this helps.

Greetings,
Tsvetomir Tsonev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Upload
Asked by
CD
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or