I have form in html:
<form enctype="multipart/form-data" id="client-form" method="post" accept-charset="UTF-8" action="{{ path('contact_form_message') }}" class="modal-form">
<div class="row">
<input title="attachment" type="file" class="pull-left file-inp" multiple name="files">
<input type="hidden" name="MAX_FILE_SIZE" value="52428800" />
<button href="#" id="submit" class="btn send static-form-button">Send</button>
</div>
</form>
php:
foreach ($files as $file)
{
if ($file)
{
if ($file->getSize() > $this->container->getParameter('attachments_max_size', 52428800 ))
{
$message = "File size limit exceeds";
}
else
{
if(is_uploaded_file($file->getPathName()))
{
$fileName = uniqid().'_'.str_replace(' ','_',$file->getPathName().'.'.$file->guessExtension());
$attachment = $file->move($attachments_dir, $fileName);
$link = $request->getHost().'/uploads/media/attachments/'.$attachment->getFileName();
$path = $attachment->getPathName();
}
else
{
$message = 'Error uploading file';
}
}
}
}
But I have a problem that I can upload files size with max size of 1mb.
I want 50mb. What I am doing wrong?
P.S Maybe I must use jQuery for this?