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

Passing metadata for each file in multiple upload

1 Answer 63 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 31 Dec 2013, 10:33 PM
I am using Razor and have screens where I can upload multiple files.  These will not be async, but for every file that is selected I need to put that file in a category.

I thought I could use the template to put the dropdown in after the file was selected.  Then they would select the dropdown next to each file and set them correctly.  Then they would click save, but how can I post that data back and tie it to each file if I have multiple files.  Thank you.

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 02 Jan 2014, 09:34 AM
Hello Brian,

If you are using the Upload widget as a regular file input within a form element (you mentioned you are not using async) then you can add the other input elements (or Kendo widgets) within the form and they will be send to the server along with the other input elements.

What the Upload widget actually does is that it creates file inputs like this:

<div class="k-button k-upload-button">
    <input name="files" type="file" data-role="upload" multiple="multiple" autocomplete="off" style="display: none;">
    <input name="files" type="file" data-role="upload" multiple="multiple" autocomplete="off" style="display: none;">
    <input name="files" type="file" data-role="upload" multiple="multiple" autocomplete="off" style="display: none;">
    <input name="files" type="file" data-role="upload" multiple="multiple" autocomplete="off" style="display: none;">
    <input name="files" id="files" type="file" data-role="upload" multiple="multiple" autocomplete="off"> <span>Select
                            files...</span>
 
</div>

So you should find your own way to associate metadata with Kendo Upload files the same way as you would do if you were dealing with multiple input files like the one shared above.

If using async Upload then you should send metadata like explained in the documentation.

Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Upload
Asked by
Brian
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or