티스토리 뷰
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
- Spring Boot
- 메소드 제한
- 구글 플레이 게임즈
- 설치
- 설정
- 호이안
- 다운로드
- autohotkey
- mysql
- 베트남
- lineage2m
- 라즈베리파이
- download
- java
- 수원
- 윈도우
- mariaDB
- 시즌3
- 전자정부프레임워크
- 블루스택
- Spring
- 오토핫키
- eGovFramework
- 로블록스
- 시즌패스
- nginx
- 달빛조각사
- 단축키
- tomcat
- 배드워즈
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |