Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses and challenges
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Calculator

0

73
Views
Angular FileSaver.JS change downloaded file name

I am using Angular and FileSaver to save a file but I want to specify a name to the downloaded file

this._UsersService.downloadReport(id).subscribe(data => {
  FileSaver.saveAs(data);
});
7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

Not too familiar with it, but wouldn't you just add a file name option after your data?

ex: FileSaver.saveAs(data, "my filename") ?

https://github.com/eligrey/FileSaver.js/

Edit: perhaps another relevant SO post: How to use filesaver.js

7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs