ich versuche:Wie externe Datei zu senden, verwenden Sie einfach URL (https: // .....)
.post("/getAttachments", (req, res, next) => {
repository.getAttachments(req.body)
.then((attachment) => {
return res.sendFile('https://host.com' + attachment.req.path);
})
.catch(next);
})
///clientService:
function getAttachments(params) {
return $http.post(baseUrl + "/getAttachments", params, {responseType: 'arraybuffer'}).success(function (data) {
let blob = new Blob([data], {type: 'application/vnd.ms-excel'});
saveAs(blob);
});
};
alle Arbeiten für lokale Dateien. Bitte Können Sie damit helfen?
danke, es ist wirklich hilfreich – aaaaaaaaax10