nestjs-multer-extended icon indicating copy to clipboard operation
nestjs-multer-extended copied to clipboard

Suffix in file name

Open iljab opened this issue 3 years ago • 10 comments

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

iljab avatar Jul 08 '20 21:07 iljab

Thanks for opening an issue. Is there any particular reason why do you need such a behavior?

jeffminsungkim avatar Jul 10 '20 00:07 jeffminsungkim

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.

iljab avatar Jul 10 '20 09:07 iljab

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.

rbutera avatar Jul 10 '20 11:07 rbutera

@iljab Fair enough. Would you like to create a PR for this? 😺 @rbutera Good point.

jeffminsungkim avatar Jul 10 '20 23:07 jeffminsungkim

@jeffminsungkim I will try

iljab avatar Jul 11 '20 22:07 iljab

Feel free to tell me if you need any help 😃

jeffminsungkim avatar Jul 12 '20 03:07 jeffminsungkim

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?

rubiin avatar May 03 '21 09:05 rubiin

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.

hddananjaya avatar May 04 '21 04:05 hddananjaya

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

jnovak-SM2Dev avatar Feb 21 '22 20:02 jnovak-SM2Dev

I added a pull request to fix this #515

jnovak-SM2Dev avatar Feb 21 '22 21:02 jnovak-SM2Dev