public function upload()
{
if ($this->validate()) {
$this->File->saveAs('uploads/banners/' . $this->Url . '.' . $this->File->extension);
$this->Image='uploads/banners/' . $this->Url . '.' . $this->File->extension;
return true;
} else {
return false;
}
}
I use it in controller in backend, so it save this picture in backend/webuploads/banners/. What can I do to using this function in backend but save this picture in fronten/web/uploads/baners
saveAs function uses path of the filename to be saved. If your backend and frontend are in same server, you can give the path to the frontend directory you want your file to be saved, that you must be knowing.