아파치서버

#1 context.xml <Context allowCasualMultipartParsing="true"> 

#2 server restart


BLOB : 이미지나 동영상 데이터 타입


이미지삽입(<form action="imageInsert.jsp" method="POST" enctype="multipart/form-data">) -> 서버(insert)
이미지보기 <- 서버(select)


<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

<script>

function fn(){

xmlHttp = new XMLHttpRequest();

xmlHttp.onreadystatechange = on_ready;

xmlHttp.open("GET", "imageSelect.jsp");

xmlHttp.send();

}

function on_ready(){

if(xmlHttp.readyState==4 && xmlHttp.status==200){

data = xmlHttp.responseText;

data = JSON.parse(data);

data.forEach(function(v, i){

img = document.createElement("img");

img.style.width = "300px";

img.style.height = "300px";

img.src = v.img;

myimg.append(img);

})

}

}

</script>

</head>

<body>

<div id="myimg"></div>

<button onclick="fn()">이미지 보기</button>

</body>

</html>


Server-Sent Event

server쪽에서 client쪽으로 일방적으로 데이터 보내는 것이다.

'SK고용디딤돌' 카테고리의 다른 글

직무교육 16일차(jQuery)  (0) 2017.08.03
직무교육 15일차(jQuery)  (0) 2017.08.02
직무교육 13일차(HTML5 API)  (0) 2017.07.26
직무교육 12일차(DB연동)  (1) 2017.07.25
직무교육 11일차(웹어플리케이션 & ajax)  (0) 2017.07.24

+ Recent posts