Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

% (as part of the file name) is not supported #37

Open
pillsilly opened this issue Oct 9, 2022 · 2 comments
Open

% (as part of the file name) is not supported #37

pillsilly opened this issue Oct 9, 2022 · 2 comments

Comments

@pillsilly
Copy link

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.

@cipchk
Copy link
Owner

cipchk commented Oct 9, 2022

Because ngx-filesaver used of URL parsing, so you can use:

- const fileName = `save%.${type}`;
+ const fileName = encodeURI(`save%.${type}`);

to fixed this.

@pillsilly
Copy link
Author

pillsilly commented Oct 9, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants