FileDownload |
Methods |
|
|
startDownload파일 다운로드를 시작합니다.
Syntaxvoid startDownload ( String filePath ) void startDownload ( String filePath, boolean attachment ) void startDownload ( String filePath, boolean attachment, boolean resumable ) void startDownload ( String filePath, String fileNameAlias ) void startDownload ( String filePath, String fileNameAlias, boolean attachment ) void startDownload ( String filePath, String fileNameAlias, boolean attachment, boolean resumable ) ParametersfilePath [in] 다운로드 할 파일의 경로를 입력합니다. fileNameAlias [in] 클라이언트 컴퓨터에 저장될 파일 이름(별칭)을 입력합니다. 영문이 아닐 경우, 웹서버 환경에 따라 적절히 인코딩 되어야 합니다. attachment [in] 파일의 종류에 관계 없이 항상 파일로 저장할 수 있도록 설정합니다. 기본 값은 false입니다.
resumable [in] 이어받기 모드를 설정합니다. 기본 값은 false입니다.
Return Values
Remarks
Sample CodesJava FileDownload fileDownload = new FileDownload(request, response); try { String filePath = "파일 경로"; String fileNameAlias = "파일 이름(별칭)"; // fileNameAlias는 웹서버 환경에 따라 적절히 인코딩 되어야 합니다. fileNameAlias = URLEncoder.encode(fileNameAlias, "UTF-8"); // filePath에 지정된 파일을 fileNameAlias 이름으로 다운로드 합니다. fileDownload.startDownload(filePath, fileNameAlias); } catch(CrossUploaderException ex) { System.out.println("다운로드 중 예외 발생 : " + ex.getMessage()); } catch(Exception ex) { System.out.println("다운로드 중 예외 발생 : " + ex.getMessage()); }
|