diff --git a/app/Libraries/MyStorage/FileLibrary.php b/app/Libraries/MyStorage/FileLibrary.php index 6cb0b75..379a149 100644 --- a/app/Libraries/MyStorage/FileLibrary.php +++ b/app/Libraries/MyStorage/FileLibrary.php @@ -45,6 +45,7 @@ class FileLibrary extends MyStorageLibrary $fullPath = WRITEPATH . $this->getUploadPath() . DIRECTORY_SEPARATOR . $this->getPath(); $this->makeDirectory($fullPath); $saveFilePath = $fullPath . DIRECTORY_SEPARATOR . $this->getOriginName(); + //중복된 파일명인지 확인후 새로운 이름으로 저장 if (file_exists($saveFilePath)) { $saveFile = $this->getUniqueFilename($fullPath, $this->getOriginName()); $saveFilePath = $fullPath . DIRECTORY_SEPARATOR . $saveFile;