How To Detect Whether File Download Successfully From Client Side In Mean/angular Js
I have created a chat application in which I have kept file sending functionality over chat windows. Now I want to remove files from the server end when clients successfully downlo
Solution 1:
You can use jQuery File Download plugin for your purpose, it's a simple example you can use in your client for manage the downloaded file:
$.fileDownload('urlForYourFile')
.done(function () {
alert('File download a success!');
$.post('/postChatFileSend', {fileName: 'fileName'}, function(data) {
//Check the response, if the status propery is true, the file must have been removed from the server
});
})
.fail(function() {
alert('An error has ocurred');
});
Here there are more examples
Post a Comment for "How To Detect Whether File Download Successfully From Client Side In Mean/angular Js"