public static void initFileSendHeader ( HttpServletResponse res , String filename , String contentType ) { filename = getEncodingFileName ( filename ) ; if ( contentType != null ) { res . setContentType ( contentType ) ; } else { res . setContentType ( "applicaiton/download;charset=utf-8" ) ; } res . setHeader ( "Content-Disposition" , "attachment; filename=\"" + filename + "\";" ) ; res . setHeader ( "Content-Transfer-Encoding" , "binary" ) ; res . setHeader ( "file-name" , filename ) ; }
Init file send header .