php - How to validate on max file size in laravel? -


i trying validate on max file size of 500kb in laravel :

$validator = validator::make($request->all(), [             'file'         => 'size:500', ]); 

but says file should 500 kb big. how can edit rule gives error when bigger 500kb?

ive tried :

'file'         => 'size:>=500' 'file'         => 'size:max:500' 

the documentation says nothing this:

size:value

the field under validation must have size matching given value. string data, value corresponds number of characters. numeric data, value corresponds given integer value. files, size corresponds file size in kilobytes.

according documentation:

$validator = validator::make($request->all(), [     'file' => 'max:500000', ]); 

the value in kilobytes. i.e. max:10240 = max 10 mb.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -