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

File size unavalaible #354

Open
djcaesar9114 opened this issue Mar 2, 2024 · 1 comment
Open

File size unavalaible #354

djcaesar9114 opened this issue Mar 2, 2024 · 1 comment
Labels

Comments

@djcaesar9114
Copy link

I saw in the README that you could access file name, file mimetype, but not file size? Why is that?
I'm using multer, which is based on busboy, and I can't access file size because busboy can't give it, that's why I'm opening this issue.
Thanks in advance!

@mscdex
Copy link
Owner

mscdex commented Mar 2, 2024

That's just the nature of multipart/* content: all fields are separated by a unique string of characters and not by their lengths. This format allows you to stream data without knowing the total size up front.

Regarding file sizes, I can't speak for downstream modules, but in busboy you can count the bytes yourself as the data streams in to find the total size and if you want to limit the max file size, you can do that too.

@mscdex mscdex added the question label Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants