변경 파일 목록
총 5개
변경 파일 코드
추가삭제
변경 전Board.php
| } | |
| foreach ($saveFileNmArr as $index => $saveFileNm) { | |
| $newSaveFileNm = substr(md5(microtime()), 0, 16) . rand(100, 999); | |
| $binaryData = file_get_contents($saveFileNm); | |
| $result = $imageUploadService->uploadBinaryImageToRealPath($binaryData, $movePath, $newSaveFileNm); | |
| $dbTable = self::getBoardTableName($this->req['moveBdId']); | |
| } | |
| $uploadFileNm[$i] = $file_array[$i]['name']; | |
| $saveFileNm[$i] = substr(md5(microtime()), 0, 16); | |
| $listImageWidth = $this->cfg['bdListImgWidth'] ?? 500; | |
| //이미지 아니면 섬네일 생성안됨; | |
| } | |
| $uploadFileNm = $fileData['name']; | |
| $saveFileNm = 'tmp_' . substr(md5(microtime()), 0, 16); | |
| if ($this->imageResize === true) { | |
| $result = $this->storage->upload($fileData['tmp_name'], $this->cfg['bdUploadPath'] . $saveFileNm, ['width' => $reSizeImgWidth, 'height' => $reSizeImgHeight]); | |
변경 후Board.php
| } | |
| foreach ($saveFileNmArr as $index => $saveFileNm) { | |
| $newSaveFileNm = ImageUploadService::generateSaveFileName($uploadFileNmArr[$index] ?? '', 16, true); | |
| $binaryData = file_get_contents($saveFileNm); | |
| $result = $imageUploadService->uploadBinaryImageToRealPath($binaryData, $movePath, $newSaveFileNm); | |
| $dbTable = self::getBoardTableName($this->req['moveBdId']); | |
| } | |
| $uploadFileNm[$i] = $file_array[$i]['name']; | |
| $saveFileNm[$i] = ImageUploadService::generateSaveFileName($uploadFileNm[$i]); | |
| $listImageWidth = $this->cfg['bdListImgWidth'] ?? 500; | |
| //이미지 아니면 섬네일 생성안됨; | |
| } | |
| $uploadFileNm = $fileData['name']; | |
| $saveFileNm = 'tmp_' . ImageUploadService::generateSaveFileName($uploadFileNm); | |
| if ($this->imageResize === true) { | |
| $result = $this->storage->upload($fileData['tmp_name'], $this->cfg['bdUploadPath'] . $saveFileNm, ['width' => $reSizeImgWidth, 'height' => $reSizeImgHeight]); | |
변경 전EditorUpload.php
| $result['result'] = false; | |
| try { | |
| if (file_exists($filePath)) { | |
| $saveFileName = substr(md5(microtime()), 0, 16) . rand(100, 999); | |
| $file = fopen($filePath, 'rb'); | |
| $size = filesize($filePath); | |
| $binary_data = fread($file, $size); | |
변경 후EditorUpload.php
| $result['result'] = false; | |
| try { | |
| if (file_exists($filePath)) { | |
| $saveFileName = ImageUploadService::generateSaveFileName($filePath, 16, true); | |
| $file = fopen($filePath, 'rb'); | |
| $size = filesize($filePath); | |
| $binary_data = fread($file, $size); | |
변경 전ArticlePsController.php
| if (Board::isDefaultUploadStorage($req['bdId'])) { | |
| $boardConfig = new BoardConfig($req['bdId']); | |
| $result = (new ImageUploadService())->uploadImage($fileData, '/temp', true, $boardConfig->cfg['bdUploadMaxSize']); | |
| } else { | |
| $boardAct = new ArticleActAdmin($req); | |
| $result = $boardAct->uploadAjax($fileData); | |
변경 후ArticlePsController.php
| if (Board::isDefaultUploadStorage($req['bdId'])) { | |
| $boardConfig = new BoardConfig($req['bdId']); | |
| $imageUploadService = new ImageUploadService(); | |
| // 확장자 검증 (저장소 변경 경로의 uploadAjax 와 동일하게 차단) | |
| if ($imageUploadService->isAllowUploadExtention($fileData['name']) === false) { | |
| throw new AlertBackException('업로드 할 수 없는 파일입니다.'); | |
| } | |
| $result = $imageUploadService->uploadImage($fileData, '/temp', true, $boardConfig->cfg['bdUploadMaxSize']); | |
| } else { | |
| $boardAct = new ArticleActAdmin($req); | |
| $result = $boardAct->uploadAjax($fileData); | |
변경 전BoardPsController.php
| // 기본 저장소 인지 확인 | |
| if (Board::isDefaultUploadStorage($req['bdId'])) { | |
| // 기본 저장소일 경우 OBS Upload 진행 | |
| $boardConfig = new BoardConfig($req['bdId']); | |
| $result = (new ImageUploadService())->uploadImage($fileData, '/temp', true, $boardConfig->cfg['bdUploadMaxSize']); | |
| } else { | |
| // 저장소 변경일 경우 해당 저장소에 Upload 진행 | |
| $boardAct = new BoardAct($req); | |
변경 후BoardPsController.php
| // 기본 저장소 인지 확인 | |
| if (Board::isDefaultUploadStorage($req['bdId'])) { | |
| // 기본 저장소일 경우 OBS Upload 진행 | |
| $imageUploadService = new ImageUploadService(); | |
| // 확장자 검증 (저장소 변경 경로의 uploadAjax 와 동일하게 차단) | |
| if ($imageUploadService->isAllowUploadExtention($fileData['name']) === false) { | |
| throw new AlertBackException('업로드 할 수 없는 파일입니다.'); | |
| } | |
| $result = $imageUploadService->uploadImage($fileData, '/temp', true, $boardConfig->cfg['bdUploadMaxSize']); | |
| } else { | |
| // 저장소 변경일 경우 해당 저장소에 Upload 진행 | |
| $boardAct = new BoardAct($req); | |
변경 전BoardPsController.php
| // 기본 저장소 인지 확인 | |
| if (Board::isDefaultUploadStorage($req['bdId'])) { | |
| // 기본 저장소일 경우 OBS Upload 진행 | |
| $boardConfig = new BoardConfig($req['bdId']); | |
| $result = (new ImageUploadService())->uploadImage($fileData, '/temp', true, $boardConfig->cfg['bdUploadMaxSize']); | |
| } else { | |
| // 저장소 변경일 경우 해당 저장소에 Upload 진행 | |
| $boardAct = new BoardAct($req); | |
변경 후BoardPsController.php
| // 기본 저장소 인지 확인 | |
| if (Board::isDefaultUploadStorage($req['bdId'])) { | |
| // 기본 저장소일 경우 OBS Upload 진행 | |
| $imageUploadService = new ImageUploadService(); | |
| // 확장자 검증 (저장소 변경 경로의 uploadAjax 와 동일하게 차단) | |
| if ($imageUploadService->isAllowUploadExtention($fileData['name']) === false) { | |
| throw new AlertBackException('업로드 할 수 없는 파일입니다.'); | |
| } | |
| $result = $imageUploadService->uploadImage($fileData, '/temp', true, $boardConfig->cfg['bdUploadMaxSize']); | |
| } else { | |
| // 저장소 변경일 경우 해당 저장소에 Upload 진행 | |
| $boardAct = new BoardAct($req); | |