Skip to content

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

Open
AbhilakshSinghReen wants to merge 1 commit into
expressjs:mainfrom
AbhilakshSinghReen:disk-destination-double-check
Open

DiskStorage destination folder check for when the destination is passed as a function.#1067
AbhilakshSinghReen wants to merge 1 commit into
expressjs:mainfrom
AbhilakshSinghReen:disk-destination-double-check

Conversation

@AbhilakshSinghReen

Copy link
Copy Markdown

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.

@mriedem

mriedem commented Feb 7, 2022

Copy link
Copy Markdown

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.

@LinusU

LinusU commented Mar 16, 2022

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Author

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 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants