Answer the question
In order to leave comments, you need to log in
How to set the filename when rendering it from a stream?
The server (in Laravel) generates a PDF and sends it as a string to the client in Angular.
The client outputs this way:
var file = new Blob([response.data], {type: 'application/pdf'});
var fileURL = URL.createObjectURL(file);
$window.open($sce.trustAsResourceUrl(fileURL));
Answer the question
In order to leave comments, you need to log in
Try like this
var blob = new Blob([response.data], {type : 'application/pdf'});
var fileOfBlob = new File([blob], 'fileName.pdf');
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question