Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Size File Validation only deals with Kilobytes #2658

Open
JoshSalway opened this issue Jul 1, 2021 · 0 comments
Open

Size File Validation only deals with Kilobytes #2658

JoshSalway opened this issue Jul 1, 2021 · 0 comments

Comments

@JoshSalway
Copy link

JoshSalway commented Jul 1, 2021

It would be great if Laravel File Size would allow you to specify file size and the metric (eg. megabyte|mb, gigabyte|gb etc).

So instead of just:

// Validate that an uploaded file is exactly 512 kilobytes...
'image' => 'file|size:512';

Could do:
// Validate that an uploaded file is less then 2 mb...
'image' => 'file|size:2,mb';
// Validate that an uploaded file is less then 2 gb...
'image' => 'file|size:2,gb';

https://laravel.com/docs/8.x/validation#rule-size
https://laravelexamples.com/example/agorakit/helpers

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant