Return Success even on Error

2 posts, 0 answers
  1. TeleCommunication Systems
    TeleCommunication Systems avatar
    1 posts
    Member since:
    Feb 2008

    Posted 26 Jan 2015 Link to this post

    I am using this control to upload files to SharePoint 2013 and have customized it to update the meta data in SharePoint prior to finishing the upload.  Unfortunately, the only way i could do this was to use the SharePoint JSOM in the Upload event of the control.  The result is a successful upload however it appears to have failed to the control.  How can i return a success to the control even in the event of an error?

    $("#files").kendoUpload({
                        async: {
                            saveUrl: function (o) {
                              
                            },
                            autoUpload: false
                        },
                        upload: function (e) {
                            uploadFile(e);
                            return "";
                        }
                    });

    uploadFile is where all the work is done.  What can i return to the kendoUpload control so that it appears as if the upload was successful?
    Thanks
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 27 Jan 2015 Link to this post

    Hello,


    The status of the uploaded file is updated depending on the result returned from the async.saveUrl handler. An empty response or JSON string with "text/plain" encoding signifies success. Any other response will be treated as error. I would suggest to modify the save handler accordingly.

    Regards,
    Dimiter Madjarov
    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