In my Symfony 6.4 project, I have a form with a file input and a maxSize set to 5M. On my web server in development mode (Symfony) with PHP 8.3.6, if I try to upload a file that’s 20M, the form displays an error message.
However, on my production server (Apache 2, PHP 8.3.6), the form does not display the error.
->add(
'file',
FileType::class,
[
"required" => false,
"label" => "Ajout d'un document",
"multiple" => true,
"help" => "Formats : .pdf, .doc, .docx, .xlsx",
"constraints" => [
new All([
"constraints" => [
new File([
"maxSize" => "5M",
'maxSizeMessage' => "Le fichier est trop volumineux. La taille maximale autorisée est de 5 Mo.",
'mimeTypes' => [
'application/pdf',
'text/csv',
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
],
'mimeTypesMessage' => "Seuls les formats : .pdf, .doc, .docx, .xlsx sont autorisés.",
])
]
])
],
"attr" => [
"accept" => ".pdf,.csv,.doc,.docx,.xls,.xlsx"
]
]
)
In my php.ini :
post_max_size = 20M
upload_max_filesize = 10M
I tried to change php.ini but no effect