FileDownload

Methods

 

 

startDownload

파일 다운로드를 시작합니다.

 

Syntax

    void 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 )

Parameters

filePath

[in] 다운로드 할 파일의 경로를 입력합니다.

fileNameAlias

[in] 클라이언트 컴퓨터에 저장될 파일 이름(별칭)을 입력합니다. 영문이 아닐 경우, 웹서버 환경에 따라 적절히 인코딩 되어야 합니다.

attachment

[in] 파일의 종류에 관계 없이 항상 파일로 저장할 수 있도록 설정합니다. 기본 값은 false입니다.

true

파일의 종류에 관계 없이 항상 파일로 저장합니다.

false

파일 종류 및 클라이언트 컴퓨터의 환경에 따라 파일이 웹브라우저에서 열릴 수 있습니다.

resumable

[in] 이어받기 모드를 설정합니다. 기본 값은 false입니다.

true

파일 다운로드 시 이어받기 모드로 동작합니다. 클라이언트에서 이어받기 요청이 있어야 하며, 없을 경우 일반 다운로드 모드로 동작합니다.

false

파일 다운로드 시 일반 다운로드 모드로 동작합니다.

 

Return Values

 

Remarks

 

Sample Codes

Java

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()); 	
}