I have problem upload files through slim framework 3 Slim\Http\UploadedFile.
My code:
$app->post('/upload', function ($req, $res, $args) {
$setting = $this->settings;
$uploadPath = $setting['upload']['path'];
$file = $req->getUploadedFiles()['img'];
$file->moveTo($uploadPath);
return $res;
});
Result:
Slim Application Error
The application could not run because of the following error:
Details
Type: RuntimeException
Message: Error moving uploaded file hss.png to /home/xxx/web/slim3/app/../log
File: /home/xxx/web/slim3/vendor/slim/slim/Slim/Http/UploadedFile.php
Line: 237