FileUpload

Methods

 

 

startUpload

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

 

Syntax

    void startUpload ()
    void startUpload ( String saveDirPath )

Parameters

saveDirPath

[in] 임시 파일을 저장할 경로를 설정합니다. saveDirPath를 입력하지 않으면 시스템의 임시 경로로 파일 업로드를 시작합니다.

 

Return Values

 

Remarks

 

Sample Codes

Java

FileUpload fileUpload = new FileUpload(request, response);
try {	
	fileUpload.setAutoMakeDirs(true);
	String saveDirPath = request.getRealPath("/");
	saveDirPath += ("UploadDir" + File.separator);
	
	// saveDirPath에 지정한 경로로 파일 업로드를 시작합니다.  
	fileUpload.startUpload(saveDirPath); 	
	
	FileItem[] fileItems = fileUpload.getFileItems("files");
	if(fileItems != null) { 
	}
}
catch(CrossUploaderException ex) { 
}
catch(Exception ex) { 
	fileUpload.deleteUploadedFiles(); 
} 
finally { 
	fileUpload.clear(); 
}