Open AmineHouari98 opened 2 years ago
Hi, maybe add a callback function to the configuration of FormDataInterceptorConfig
to get the filename before saving it to local storage?
Could you guide me with a callback function to the configuration of FormDataInterceptorConfig to get the filename?
Hi @AmineHouari98 @chhonhourseng
If you are using DTO, you can achieve this with @Transform
decorator (class-transformer
package):
@Transform(({ value }: { value: MemoryStoredFile }) => {
value.originalName = 'new name';
return value;
})
file: MemoryStoredFile;
Hi, maybe add a callback function to the configuration of
FormDataInterceptorConfig
to get the filename before saving it to local storage?
can you give us the example? please.
as the title said it would be nice to add a way to add a middleware to rename uploaded files before saving to local storage , i think this feature is a must when working with files !