I use symfony HttpFoundation for upload files, the FileBag works if I call all()
, but if I use get('document_name')
it return null
.
use Symfony\Component\HttpFoundation\Request;
public function saveFileAction(Request $request) {
dump($request->files->all());
dump($request->files->get('document'));
}
For all() I get following response:
FileController.php on line 175:
array:1 [▼
"form" => array:1 [▼
"document" => UploadedFile {#14 ▶}
]
]
What I do wrong here? Does somebody know why I can't get the single file with get()
method? I found in symfony documentation I found that $request->files->get('document')
should work...