ePezhman
ePezhman

Reputation: 4010

How to change removeUrl of Kendo UI upload async in onSuccess?

I'm using upload async to upload files via ajax, and I need to update the removeUrl based on the idea of the uploaded file which returns from server after insert in database, how can I do this? it seems there is no method for changing that in api documentations, thanks

Upvotes: 0

Views: 587

Answers (1)

ceaggregation
ceaggregation

Reputation: 195

e.sender.options.async.removeUrl is where the removeUrl is. Just change it to whatever suits your needs. Like this

function onSuccess(e) 
{
       if (e.operation == "upload")
       {
          //do your stuff, server response is in e.response
          e.sender.options.async.removeUrl ="newUrl";
       }
}

If you're uploading many files at once and want to set removeUrl for each one to be different, then the simplest approach would be to store server response from success somewhere, tap into remove event and change the removeUrl there.

Upvotes: 1

Related Questions