Passing metadata for each file in multiple upload

2 posts, 0 answers
  1. Brian
    Brian avatar
    1 posts
    Member since:
    Dec 2013

    Posted 31 Dec 2013 Link to this post

    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.
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 02 Jan 2014 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top