기본 콘텐츠로 건너뛰기

다운로드 파일명 깨짐현상 처리

웹개발시 파일 다운로드 할때 한글 특수 문자 깨짐..

이것이 설명이 잘되 있는데 공백 처리는 되는데 !@#$%^&*() 이거 처리도 되는지 잘모르겠다

http://devdic.tistory.com/26
public static String getBrowser(HttpServletRequest request) {
   String userAgent = request.getuserAgent("User-Agent");
  
   if (userAgent.indexOf("MSIE") > -1 || userAgent.indexOf("Trident") > -1 ){
        //IE 버전 별 체크  >>  Trident/7.0(IE 11), Trident/6.0(IE 10) , Trident/5.0(IE 9) , Trident/4.0(IE 8)
        return "MSIE";
   } else if (userAgent.indexOf("Chrome") > -1) {
        return "Chrome";
   } else if (userAgent.indexOf("Opera") > -1) {
        return "Opera";
   } else if ( userAgent.indexOf("Firefox") > -1 ) {
        return "Firefox";
   }
   return "Safari";
}

댓글

이 블로그의 인기 게시물

dmesg 메시지 실시간으로 보기

참조사이트 http://imitator.kr/Linux/556 # tail -f /var/log/messages # tail -f |dmesg //기본 2초 단위로 갱신 된다. # watch "dmesg | tail -f" //1초 단위로 갱신하면서 보여준다. # watch -n 1 "dmesg | tail -f" // 보여주는 줄을 20으로 늘린다. (기본 10줄) # watch -n 1 "dmesg | tail -f -n 20"

java 특정 디렉토리에 있는 파일 목록을 읽어내기, 정렬해서 가져오기

폴더 리스트 가져오기 String path="C:\"; File dirFile=new File(path); File []fileList=dirFile.listFiles(); for(File tempFile : fileList) {   if(tempFile.isFile()) {     String tempPath=tempFile.getParent();     String tempFileName=tempFile.getName();     System.out.println("Path="+tempPath);     System.out.println("FileName="+tempFileName);     /*** Do something withd tempPath and temp FileName ^^; ***/   } } 정렬해서 가져오기 import java.io.FileFilter; import java.io.IOException; import java.util.Arrays; import java.util.Date; import org.apache.commons.io.comparator.LastModifiedFileComparator; import org.apache.commons.io.filefilter.FileFileFilter; public class LastModifiedFileComparatorTest { public static void main(String[] args) throws IOException { File directory = new File("."); // get just files, not directories File[] files = directory.listFiles((FileFilter) FileFileFilter.FILE); System.out.println("Defaul...