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

Return Success even on Error

1 Answer 243 Views
Upload
This is a migrated thread and some comments may be shown as answers.
TeleCommunication Systems
Top achievements
Rank 1
TeleCommunication Systems asked on 26 Jan 2015, 09:47 PM
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

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 27 Jan 2015, 08:22 AM
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!
 
Tags
Upload
Asked by
TeleCommunication Systems
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or