nestjs-multer-extended
nestjs-multer-extended copied to clipboard
Suffix in file name
Hi, is it possible to add the suffix to the file name and not the extension?
Current naming (resized lg): 58757eba-c286-46f0-b3c5-3c27473d7c2c.jpeg**-lg**
Expected naming behavior: 58757eba-c286-46f0-b3c5-3c27473d7c2c**-lg**.jpeg
Thanks for opening an issue. Is there any particular reason why do you need such a behavior?
If for example a customer downloads an image with the .jpeg-lg ending, most of the tools won't recognize it as an image. The original file ending gets lost.
If for example a customer downloads an image with the .jpeg-lg ending, most of the tools won't recognize it as an image. The original file ending gets lost.
+1
In my opinion, I think that the current implementation is useful for a "file extension suffix" but does not serve the purpose of a "file name" suffix.
@iljab Fair enough. Would you like to create a PR for this? 😺 @rbutera Good point.
@jeffminsungkim I will try
Feel free to tell me if you need any help 😃
Hi, is it possible to add the suffix to the file name and not the extension?
Current naming (resized lg): 58757eba-c286-46f0-b3c5-3c27473d7c2c.jpeg**-lg**
Expected naming behavior: 58757eba-c286-46f0-b3c5-3c27473d7c2c**-lg**.jpeg
is this when using randomFIleName option?
Hi, is it possible to add the suffix to the file name and not the extension? Current naming (resized lg): 58757eba-c286-46f0-b3c5-3c27473d7c2c.jpeg**-lg** Expected naming behavior: 58757eba-c286-46f0-b3c5-3c27473d7c2c**-lg**.jpeg
is this when using randomFIleName option?
It happens with and without rahdomFileName
option.
Any update on this? The suffix should definitely be attached to the file name and not the extension as to not cause issues with anything that would read an image/image extension (such as js galleries, etc).
I added a pull request to fix this #515