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

safeFileName #21

Closed
AlexNodex opened this issue Feb 22, 2017 · 5 comments
Closed

safeFileName #21

AlexNodex opened this issue Feb 22, 2017 · 5 comments

Comments

@AlexNodex
Copy link

When safeFileName is set to true in the options, it removes the dot from the file extension thus rendering the extension useless, it might be an idea to allow dots also.

@bchr02
Copy link

bchr02 commented Mar 2, 2017

that would explain why I am getting an unsupported MIME type error

@AlexNodex
Copy link
Author

AlexNodex commented Mar 2, 2017 via email

@bchr02
Copy link

bchr02 commented Mar 2, 2017

I believe the MIME type error was coming from another lib that I am using in conjunction with express-fileupload as a result of the file extension missing..

@richardgirges
Copy link
Owner

I really do hope the lib doesn't rely on file extension to set mime type, that would be extremely insecure to rely on !!

@AlexNodex that is certainly not the case. express-fileupload uses busboy to detect mime types. :)

As for this issue, thanks for bringing it up - it will be resolved in an upcoming release real soon.

@richardgirges
Copy link
Owner

New release: v0.1.3 has been published to NPM. A new feature, courtesy of @pronein addresses this issue.

You can now pass in preserveExtension as an option in the express-fileupload middleware. Example usage:

app.use(fileUpload({ safeFileNames: true, preserveExtension: true }));

Read more detail about the feature on the README.

This was referenced Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants