# The image max rule is kilobytes

> max:2048 on a file is 2 MB. PHP can reject the upload first, and Laravel then looks like the field was empty.

- URL: https://laravel-vuejs.space/laravel-image-max-kilobytes-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs

People searching “Laravel image max size” set `max:2` and then a normal photo fails. On a file, `max` is kilobytes. `2048` is 2 MB. The [upload guide](https://laravel-vuejs.space/laravel-vue-file-upload) is the form. This page is the number.

> **TL;DR**
>
> -   max:2048 on a file is 2 MB.
> -   PHP can reject the upload first, and Laravel then looks like the field was empty.
> -   Do not compare the size in Vue and skip the rule.
> -   Do not write `max:2` and add a comment that says “2 MB”.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

```php
'cover' => ['nullable', 'image', 'max:2048'],
```

If `php.ini` `upload_max_filesize` is smaller, PHP drops the file before Laravel. The field arrives empty. The error looks like `required` failed, or the nullable field is quietly missing. Raise `upload_max_filesize` and `post_max_size` together, above the Laravel rule, so the rule is the one the user sees.

The Vue input can set `accept="image/*"`. That does not enforce the size. Print `form.errors.cover`.

## What to avoid

> **Gotcha**
>
> Do not compare the size in Vue and skip the rule. A person can POST a larger body without your component. Do not write `max:2` and add a comment that says “2 MB”. The next reader will believe the comment.

## FAQ

**Q: Is the Laravel image max rule in kilobytes?**

max:2048 on a file is 2 MB. PHP can reject the upload first, and Laravel then looks like the field was empty.

**Q: What goes wrong with Laravel image max size?**

Many developers set `max:2` and then a normal photo fails. Do not compare the size in Vue and skip the rule.
