Skip to content Skip to sidebar Skip to footer

Open Pdf In New Tab, Saving File Gives Wrong File Name

There is an Angular 6 app having a feature to download pdf files. It uses REST API from another Spring Boot application to download files. The requirement is that i need to open pd

Solution 1:

You could use file-saver library as follow:

import { saveAs } from 'file-saver';
...
awesomeDownloader(url: string, fileName: string) {
  const blobFile = functionsThatGetsTheBlob(url);
  saveAs(blobFile, fileName);
}
...

Post a Comment for "Open Pdf In New Tab, Saving File Gives Wrong File Name"