I have a question. I need to know how to download a file with angularJS and C # MVC . I already managed to save the file in a separate route, but when downloading I do not know how to recover it. I understand that it is by method GET
.
This is how I am sending the file:
var config = {
headers: {
'Content-Type': undefined
},
transformRequest: function(data) {
var formData = new FormData();
formData.append("jsonData", angular.toJson(data.jsonData));
for (var i = 0; i < data.files.length; i++) {
formData.append("file" + i, data.files[i]);
}
return formData;
}
};
var datos = {
jsonData: solicitud,
files: archivo
};
$http.post('./GuardarSolicitudConArchivo', datos, config).then(successCallback, errorCallback);