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
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.
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 expectedrandom.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