Cancel downloading a file on the server when it is canceled from the client

I am using kendo file upload control in my application. For example, I select a file with a size of 20 MB. The request is sent to the server, which should load this document in azure + insert a database record pointing to blob.

The problem is that if the server has all the bytes transferred, and the rest of the operations are performed (for example, downloading a file and inserting a record into the database), and at the same time, the user cancels the download from the client, he gets canceled on the client side. The BUT server is still loading. How should I handle this? Any thoughts?

Thanks!

0
source share
1 answer

This is not something that should be resolved using any client side because I do not believe that you can make a new request when the browser closes, and it certainly will not work if the connection is interrupted due to network problems or is canceled. Yes, there is an undo event, you have to call the server side method to undo delete the downloaded file.

Take a look at this post and Lukas answer on stackoverflow and use the cancel event in the kendo download.

How to stop file transfer if browser is closed / loaded canceled

0
source

Source: https://habr.com/ru/post/1384863/


All Articles