Closed fomojola closed 7 years ago
Never mind: done.
For future reference (without any error checking):
Upload.upload({
url: url,
data: { file: file }
}).then(function(response){
var blob = new Blob([response.data], { type: 'text/plain' }), url = $window.URL || $window.webkitURL;
blob.name = "download.txt";
document.location.href = url.createObjectURL(blob);
}, function(response){});
I have a file upload that is sending back a manipulated file: I'm trying to have the browser automatically trigger a file download and save dialog (like you'd get from a regular multipart post if the Content-Disposition header is set to "attachment; filename=". Is there a way to do this with ng-file-upload, so the response to the Upload.upload call is automatically saved by the browser or prompts the user to save?