Keeping the original filename extension keeps more than is should
Wengiel31 opened this issue · 0 comments
Wengiel31 commented
Support plan
- Which support plan is this issue covered by? (Community, Sponsor, Enterprise): Community
- Currently blocking your project/work? (yes/no): no?
- Affecting a production system? (yes/no): yes
Context
- Node.js version: 10.19.0
- Release Line of Formidable (Legacy, Current, Next): Current
- Formidable exact version: 3.2.4
- Environment (node, browser, native, OS): Node
- Used with (popular names of modules): Express
What are you trying to achieve or the steps to reproduce?
When using keepExtensions
option and the original filename includes multiple dots the entire original filename is kept instead of only the part from the last dot.
Eample:
The original filename is: one.two.txt
Then the name of the file saved on the server is: random.two.txt
instead of the expected random.txt
I assume it has been done on purpose to assure correct handling of files like .tar.gz
, nevertheless I think the default behavior should be as shown above. It would be nice to at least have an option to control how the original filename is parsed.
What was the result you got?
random.two.txt
What result did you expect?
random.txt