Open PDF in new tab, saving file gives wrong file name

前端 未结 1 1195
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-27 07:56

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

相关标签:
1条回答
  • 2021-01-27 08:13

    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);
    }
    ...
    
    0 讨论(0)
提交回复
热议问题