Hi Erel.
I programming httpserver
acctualy start httpserver and in chrome connect address example 192.168.1.2:5555
and send picutre with :
Response.SetContentType("image/jpeg")
Response.SendFile(File.DirRootExternal,"a.jpg")
"a.jpg" is file that i save it with camera
and in server(192.168.1.2:5555) i download picutre with ajax :
when use ajax,httpserver detect request and send image to it but i cannot show it
how Erel(Thank's)?
I programming httpserver
acctualy start httpserver and in chrome connect address example 192.168.1.2:5555
and send picutre with :
Response.SetContentType("image/jpeg")
Response.SendFile(File.DirRootExternal,"a.jpg")
"a.jpg" is file that i save it with camera
and in server(192.168.1.2:5555) i download picutre with ajax :
PHP:
var img;
$(document).ready(function() {
download();
img = document.createElement('img');
document.body.appendChild(img);
});
function hexToBase64(str) {
return btoa(String.fromCharCode.apply(null, str.replace(/\r|\n/g, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" ")));
}
function download() {
setInterval(function() {
this.xhr = $.ajax({
type: 'GET',
dataType: 'image/jpg',
url: "a.jpg",
}).success(function (data) {
img.src = 'data:image/jpeg;base64,' + hexToBase64(data);
});
},200);
}
how Erel(Thank's)?