Example #1
0
 function execute()
 {
     $ftp = $this->container->get('ftp');
     $dir = $this->getParameter('dir', '/');
     $parent = $this->getParameter('path', '/');
     $entry = $this->getParameter('entry', '');
     $current = rtrim($parent, '/') . '/' . ltrim($dir, '/');
     $this->debug(array('dir' => $dir, 'parent' => $parent, 'current' => $current, 'entry' => $entry));
     $entry = base64_decode($entry);
     // TODO::한글변환을 해야 한다.
     $filename = iconv('utf-8', 'euc-kr', $entry);
     $this->debug($entry);
     $model = new \App\Models\Ftp($ftp);
     $res = $model->download($current, $entry);
     $fileDownload = FileDownload::createFromFilePath($res);
     $fileDownload->sendDownload($filename);
 }