Hello im using invo template to create a personal project. I create this folder manually -> projectname/public/img/ <- i need to upload images in that folder, i tryed everithing.
this is the form:
<?php
echo $this->tag->form(array("admin/newPlace", "method" => "post", "enctype" => "multipart/form-data"));
?>
<input class="form-control" id="picture" name="picture" type="file">
<button type="submit" class="btn btn-primary">Guardar</button>
in the controller:
class AdminController extends ControllerBase
{
public function newPlaceAction()
{
if ($this->request->hasFiles() == true) {
$baseLocation = 'img/';
foreach ($this->request->getUploadedFiles() as $file) {
$file->moveTo($baseLocation . $file->getName());
}
}
but notting happends, please help me!!
Im using INVO template