Closed JeromeVi closed 7 years ago
I made it
Mind sharing your solution @JeromeVi ?
@YuukanOO yes of course:
Server
function sendTheGraphic(from){
//we read the file and we got a string
var fileString = fs.readFileSync("mysource.svg","utf8");
//we send this string to the client
Streamy.emit('theGraph', {
result: fileString,
}, from);
}
Client
Streamy.on('theGraph', function(result) {
//we remove the first line (it's static)
var htmlGraph = result.result.replace("<?xml version='1.0' encoding='UTF-8' standalone='no'?>","");
//and we add the code to our client web page
document.getElementById('divGraph').innerHTML = htmlGraph;
});
Is it possible to send an image with streamy ? it's a svg file that I need to transfer from Server to Client