eligrey / FileSaver.js

An HTML5 saveAs() FileSaver implementation
https://eligrey.com/blog/saving-generated-files-on-the-client-side/
Other
21.66k stars 4.38k forks source link

PDF file is not generated properly if it has dots in the name #634

Open VarfolomeevaTD opened 4 years ago

VarfolomeevaTD commented 4 years ago

Creating pdf files without dots works fine. For example, if I want to create a file called 'somefile', I will get somefile.pdf. But if I try to create 'some.file' I will get some.file, not pdf file. I guess, saveAs function interprets symbols after dot as a file extension. This happens only with pdf files, other types of files, such as excel files, work fine.

kaarelr commented 3 years ago

Same issue for MP4 files.

calling saveAs with somefile as the name works and the downloaded file outputs as somefile.mp4. However with some.file as the name it breaks and doesn't apply the proper extension. The resulting file is then not openable on macOS with Quicktime unless you explicitly add .mp4 to the end of the file.