Uploading Multiple Files

6 posts, 0 answers
  1. Keith
    Keith avatar
    2 posts
    Member since:
    Feb 2012

    Posted 16 May 2012 Link to this post

    Hello,

    I'm trying to upload multiple files at a time; I'm receiving both of the files but they're coming one after another and passing a single file rather then an array of two files like I would have hoped and expected.

    Here is the code that I've written:

    in Html
       <input name="docs[]" id="docs" type="file" />


    in js:
    $("#docs").kendoUpload({
            async: {
                saveUrl: '/Form/'+selectedSubscription.subscriptionId+'/uploadTransactionDocs',
                autoUpload: false
            },select: attachClickHandler, 
            success : function(e){
            if(e.response.status=='success'){
            docsReceivedLoad = e.response.msg;
            }
            }
        });


    function attachClickHandler(e)
    {
    window.setTimeout(function() {
            $(".k-upload-selected").click(function(e) {
                // custom logic
            if (false) {
                    e.preventDefault();
                    return false;
                }
           
            });
        }, 1);
    }

    Any idea why the saveUrl is being called twice with two files rather then 1 time with an array of 2 files?

    Thank you.
    Keith
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 19 May 2012 Link to this post

    Hi,

    The upload does not guarantee the order or number of files per request in asynchronous mode. The exact behavior depends on the capabilities of the browser in use. We have plans to provide better control in future versions.

    For now, you have to keep track of the order using metadata. Alternatively, you can use the synchronous upload.

    I hope this helps.

    Kind regards,
    Tsvetomir Tsonev
    the Telerik team
    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
  4. zenit1
    zenit1 avatar
    12 posts
    Member since:
    Jun 2008

    Posted 07 Nov 2012 Link to this post

    Hi , Tsvetomir 

    I observe the same behavior on MVC Q2 .

    I mean , what in asynchronic multiple mode  it send files to server one by one.

    I test example project from installation folder in 3 major browsers: in FF and Chrome it's send one by one and in IE multiple mode doesn't work 

    Some improvements expecting in this functionality?

    Best regards

    Serge 


  5. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 15 Nov 2012 Link to this post

    Hi,

    You can try the new batch option. When set to true the Upload will do its best to group the uploaded files into a single request.

    I hope this helps.

    Regards,
    Tsvetomir Tsonev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Srinivasa Rao
    Srinivasa Rao avatar
    2 posts
    Member since:
    Mar 2015

    Posted 28 Apr 2015 Link to this post

    I am having the same issue. Only few of the files are getting uploaded (especially first and last) and rest are failing. Is there any solution for this or its confrmed thats a bug in the Kendo Upload. Please help!

    Index.cshtml : <input name="files" id="files" type="file" multiple="multiple" />

    JS File :

    $("#files").kendoUpload   
    ({       
    async: {           
    saveUrl: "/Controller/GetUserUploadedFiles",           
    removeUrl: "/Controller/Remove",           
    autoUpload: false,           
    allowmultiple: true,          
    batch: true   
       },             
    select: function
    (e) {           
    onSelect(e);       
    },       
    success: function
    (e) {       
    },       
    error: function
    (e) {       
    }

    });

    //Controller Method

    [HttpPost]

    public void GetUserUploadedFiles(IEnumerable<HttpPostedFileBase> files)
    {   
      //Custom logic here
    }
    Is there anything i am missing or doing wrong ?

    Thanks,

    Srini

  7. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 29 Apr 2015 Link to this post

    Hello Srinivasa,

    I covered the question in the other thread on the same topic. Let's continue the discussion there.

    I am looking forward to hearing from you.

    Regards,
    Dimiter Madjarov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready