for one file:
if($this->request->isPost()) {
$picture = $this->request->getUploadedFiles()[0];
// If uploaded
if (!$picture->getError()) {
$picture->moveTo('path/to/save/' . $picture->getName());
}
}
for several files:
if($this->request->isPost()) {
foreach($this->request->getUploadedFiles() as $picture) {
if(!$picture->getError()) {
$picture->moveTo('path/to/save/' . $picture->getName());
}
}
}
In template:
<form action="" method="post" enctype="multipart/form-data">
...
<input type="file" name="my_picture">
...
<input type="submit" value="Upload">
</form>