eligrey / eligrey/FileSaver.js

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

Open
#807 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22k
Forks
4.3k
PR merge metrics
No merged PRs in 30d

Description

I am using the file-saver in an Angular application. I imported and used the file-saver by the following line:
```typescript
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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.