multer icon indicating copy to clipboard operation
multer copied to clipboard

DiskStorage destination folder check for when the destination is passed as a function.

Open AbhilakshSinghReen opened this issue 2 years ago • 3 comments

The 'DiskStorage' function in 'storage\disk.js' will now check if the destination folder exists on the disk or not. Earlier this check was only being performed when the destination was passed as a string, not when the destination was passed as a function. Changes have also been made to throw a type error if the destination is a type other than a function or a string.

AbhilakshSinghReen avatar Jan 25 '22 13:01 AbhilakshSinghReen

The README should be updated:

https://github.com/expressjs/multer/blob/master/README.md#diskstorage

Note: You are responsible for creating the directory when providing destination as a function.

mriedem avatar Feb 07 '22 18:02 mriedem

I'm not sure if we would be able to release this in 1.x since I think it's a breaking change?

And in 2.x we have removed DiskStorage 😅

LinusU avatar Mar 16 '22 16:03 LinusU

Okay. No problem. Thanks for the update.

I'm not sure if we would be able to release this in 1.x since I think it's a breaking change?

And in 2.x we have removed DiskStorage 😅

AbhilakshSinghReen avatar Mar 25 '22 06:03 AbhilakshSinghReen