sql >> Base de Datos >  >> NoSQL >> MongoDB

cómo detectar si el archivo se descarga correctamente desde el lado del cliente en js medio/angular

Puede usar Descarga de archivos jQuery complemento para su propósito, es un ejemplo simple que puede usar en su cliente para administrar el archivo descargado:

$.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');
    });

Aquí hay más ejemplos