File: /var/www/vhosts/creativefellows.nl/firstbrick.creativefellows.nl/src/Action/Upload/UploadAction.php
<?php
namespace App\Action\Upload;
use App\Action\Action;
use App\Domain\Upload\Service\UploadHandler;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Container\ContainerInterface;
use Slim\Interfaces\RouteParserInterface;
final class UploadAction extends Action
{
protected $container;
public function __construct(
ContainerInterface $container//,
//UploadHandler $uploader
) {
$this->container = $container;
//$this->uploader = $uploader;
}
public function action() : ResponseInterface
{
$options = array(
"upload_dir" => "../content/upload/",
"upload_url" => "content/upload/",
"param_name" => "files",
"delete_url" => "uploadfiles"
);
$upload_handler = new UploadHandler($options);
// return to complete page
return $this->response->withStatus(200);
}
private function replaceText($template_email_name, $replacements)
{
$text_email = file_get_contents($this->template_path . $template_email_name);
$keys = array_keys($replacements);
$values = array_values($replacements);
return preg_replace($keys,$values,$text_email);
}
}