_path = $path; } final public function getPath(): string { return $this->_path; } final public function getFileName(): string { return $this->_fileName; } final public function setFileName(string $fileName): void { $this->_fileName = $fileName; } final public function getMimeType(): string { return $this->_mimeType; } public function save($content): bool { $fullPath = WRITEPATH . $this->getUploadPath() . DIRECTORY_SEPARATOR . $this->getPath(); if (!is_dir($fullPath)) { if (!mkdir($fullPath)) { throw new \Exception("Make Directory Error:" . $fullPath); } } $saveFile = $fullPath . DIRECTORY_SEPARATOR . $this->getFileName(); log_message("debug", "Storage Save-> " . $saveFile); if (!file_put_contents($saveFile, $content)) { return false; } //File형식에 따른 MimeType 지정 $this->_mimeType = mime_content_type($saveFile); return true; } }