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

MaxFileSize per file in multiples #607

Closed
Arwantys opened this issue Apr 13, 2020 · 6 comments · Fixed by #791
Closed

MaxFileSize per file in multiples #607

Arwantys opened this issue Apr 13, 2020 · 6 comments · Fixed by #791

Comments

@Arwantys
Copy link

Hi, I would like to know if it is possible to configure MaxFileSize for each file sent with multiples, because currently it is the size plus all the files and not per file, a solution?

Thank you !

@auto-comment
Copy link

auto-comment bot commented Apr 13, 2020

Thank you for raising this issue! We will try and get back to you as soon as possible. Please make sure you format it properly, followed our code of conduct and have given us as much context as possible.
/cc @tunnckoCore @GrosSacASac

@tunnckoCore
Copy link
Member

I think that options.maxFileSize should be per file currently. Can you give an example?

Also, I think you can use the file event and throw in it if the size is exceeded.

@Arwantys
Copy link
Author

@tunnckoCore Exemple, I send an array with several images in my body "files", but it adds the sizes, I don't know if it's because the images are in the same body or not

@tunnckoCore tunnckoCore reopened this Apr 20, 2020
@kmorte
Copy link

kmorte commented Nov 26, 2021

Hi,
I'm having the same issue.

EXAMPLE:
In my frontEnd I check the file is not greater than 10mb, and in formidable I have maxFileSize: 20 * 1024 * 1024,
When I append onto the formData several files lighter than 10 mb, but in over all geather than 20mb, say 5 files of 9 mb, the formidable api sends the error:
FormidableError: options.maxFileSize (20971520 bytes) exceeded, received 20987106 bytes of file data

So certainly the maxFileSize is not per file, as the param naming make someone beliefe, but for the whole package like maxAllFilesSize.

Any idea or something i'm not considering?
Thanks!

@GrosSacASac
Copy link
Contributor

I will look into it

@GrosSacASac
Copy link
Contributor

fixed in 3.2.0

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

Successfully merging a pull request may close this issue.

4 participants