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

Any possibility to save files with leading dot (.)? #807

Open
florian-berger opened this issue Mar 6, 2024 · 0 comments
Open

Any possibility to save files with leading dot (.)? #807

florian-berger opened this issue Mar 6, 2024 · 0 comments

Comments

@florian-berger
Copy link

I am using the file-saver in an Angular application. I imported and used the file-saver by the following line:

import { saveAs } from 'file-saver'

export class MyClass {
  public someFunction() {
    // defining and filling myFileContent with a Uint8Array 
    const blob = new Blob([myFileContent], { type: 'application/octet-stream' })
    saveAs(blob, '.gitignore', { type: 'application/octet-stream' })
  }
}

But the file is downloaded as gitignore - the leading dot is missing. Happens on MacOS as well as on Windows systems.

I tried duplicating the dot as well as using standard escape characters, but nothing led to a solution. Is it even possible?

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

1 participant