Jit_Log

[Nexacro] Client 단에서 파일 생생 본문

IT 공부/Nexacro

[Nexacro] Client 단에서 파일 생생

준발이오 2025. 3. 11. 08:48

들어가기 전

넥사크로 개발 중 그리드 데이터로 파일을 만들어야 하는 경우가 생겼습니다. 자바로 파일을 서버에 저장하고 다운로드 경로를 배포하는 방향으로 개발을 했으나, 불편하다는 문의에.. 가장 간단한 방법을 사용하게 되었고, 그 방법을 기록하고자 합니다.

 

개발 환경은 다음과 같습니다.

상용 프레임워크
Framework: Nexacro17

방법

VirtualFile 이라는 컴포넌트를 이용하여 클라이언트 PC에 파일을 생성했습니다.

// 파일 생성
this.VirtualFile.isExist(savePath);

/**
 * @description VirtualFile_onsuccess - 파일 관련 메소드
 */
this.VirtualFile_onsuccess = function(obj:nexacro.VirtualFile,e:nexacro.VirtualFileEventInfo)
{
	switch(e.reason) {
	case 1: // open Succ
		this.VirtualFile.write(this.ds_File.getColumn(0, "DATA"));
		break;
	case 6: // write Succ
		alert("파일이 생성되었습니다.");
		this.VirtualFile.close();
		break;
	case 10: // isExist Succ
		if (!e.fileisexist) {
			this.VirtualFile.createDirectory(savePath, true);
		}
		break;
	case 11: // createDirectory Succ
		this.VirtualFile.open(savePath + "\\" + fileName, VirtualFile.openWrite | VirtualFile.openAppend);
		break;
	default:
		break;
	}
};

 

결론

최대한 백단에 개발해서 클라이언트 PC 부하를 줄이는게 좋다고 생각했지만 역시 개발은 UX 중점인 것 같습니다. 좀 더 사용자 입장에서 개발하도록 노력해야겠습니다.