ngx-filesaver
ngx-filesaver copied to clipboard
% (as part of the file name) is not supported
on https://stackblitz.com/edit/ngx-filesaver ,
it's reproducible if you add a %
in line 56
no error prompted, no uncaught exception, no nothing.
Also I tested the FileSaver
implementation it's supported.
Because ngx-filesaver
used of URL parsing, so you can use:
- const fileName = `save%.${type}`;
+ const fileName = encodeURI(`save%.${type}`);
to fixed this.
Because
ngx-filesaver
used of URL parsing, so you can use:- const fileName = `save%.${type}`; + const fileName = encodeURI(`save%.${type}`);
to fixed this.
Thanks for the hint,
what about including the encodeURI
work inside the lib so that to clients it'll be much more intuitive?
If it sounds ok then I am ok providing PR.