node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7k stars 680 forks source link

Keeping the original filename extension keeps more than is should #887

Closed Wengiel31 closed 1 year ago

Wengiel31 commented 1 year ago

Support plan

Context

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