Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AbhilakshSinghReen
Copy link

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
Copy link

mriedem commented Feb 7, 2022

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
Copy link
Member

LinusU commented Mar 16, 2022

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

None yet

4 participants