티스토리 뷰
javascript
$("input[name=attachFile]").fileupload({
url : '<c:url value="/myurl.do"/>',
datatype : 'json',
formData : {
k1 : "k1",
atchFileId : $("#atchFileId").val(),
fileType : fileType
},
done : function(e, data){
var def = data.result[0].body.innerHTML;
var dt = jQuery.parseJSON(def);
if(dt.message == 'success'){
alert('파일 업로드가 완료되었습니다.');
}else{
alert('파일 업로드가 실패하였습니다.\n관리자에게 문의해주세요.');
}
}
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');
java
@RequestMapping(value = "/myurl.do")
public void abc(MultipartHttpServletRequest request, HttpServletResponse response) throws IOException{
~
Map rtn= new HashMap<String, String>();
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
response.setHeader("Cache-Control", "no-chche");
response.setHeader("Content-type", "text/html");
response.setHeader("charset", "UTF-8");
PrintWriter outWriter=null;
Gson gson = new Gson();
outWriter = response.getWriter();
outWriter.print(gson.toJson(rtn));
outWriter.flush();
}
'웹개발자 > js_jquery' 카테고리의 다른 글
tooltip 개행 (0) | 2018.11.30 |
---|---|
handsontable number validator, copy paste error fix (0) | 2018.07.11 |
form 동적생성 (0) | 2017.05.30 |
string to json (0) | 2017.05.30 |
json, object 데이터 크기 확인 (0) | 2017.05.30 |
- Total
- Today
- Yesterday
- 배드워즈
- autohotkey
- tomcat
- 라즈베리파이
- Spring Boot
- 달빛조각사
- 다운로드
- nginx
- 시즌패스
- 메소드 제한
- Spring
- 구글 플레이 게임즈
- download
- 설정
- java
- 전자정부프레임워크
- mysql
- 오토핫키
- eGovFramework
- 시즌3
- lineage2m
- mariaDB
- 설치
- 블루스택
- 로블록스
- 호이안
- 윈도우
- 베트남
- 단축키
- 수원
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |