Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

PetroGromovo's avatar

Testing lumen app in postman validation of big files crash the validation?

Testing lumen-framework 8.3 app with postman (v8.12.4) I need to check max size of uploaded file with validation rules like :

$uploaded_file_max_mib = (float)config('app.uploaded_file_max_mib', 1); // 1 Mib
$maxSizeInBytes              = 1024 * $uploaded_file_max_mib;

$validationRulesArray = [
    'title' => [
        'required',
        'string',
        'max:255',
        Rule::unique(with(new Page)->getTable())->ignore($page_id),
    ],
    'content'           => 'required',
    'content_shortly'   => 'nullable',

    'meta_description'  => 'nullable',
    'meta_keywords'     => 'nullable',
        'image' => [
            'nullable',
            'max:' . $maxSizeInBytes,
            new CheckImageValidExtension()
        ],

    'published'         => 'nullable|in:' . '0,1',
    'is_homepage'       => 'nullable|in:' . '0,1',
    'creator_id'        => 'required|integer|exists:' . (with(new User)->getTable()) . ',id',
];

When I have $uploaded_file_max_mib = 10 and I try to upload file more 10Mib I do not get validation errors on max size, but got several errors :

{
    "message": "The given data was invalid.",
    "errors": {
        "title": [
            "Title is required"
        ],
        "content": [
            "Content is required"
        ],
        "creator_id": [
            "Creator is required"
        ]
    }
}

If I change parameter 'uploaded_file_max_mib' => 1, and try to upload files in 3 Mib I got vaditions errors on big file as I expected.

Is it problem of postman ? Has postman some restrictions on uploaded file size? In my Kubuntu 20 I have PHP Version 7.4.25 and Apache/2.4.41 with parameters I have next parameters in apache :

post_max_size =	200M
max_execution_time = 900
max_file_uploads = 20

Thanks in advance!

0 likes
0 replies

Please or to participate in this conversation.