I'm trying to show an image on a page hosted on windows server 2016, but the image is saved on another server and both servers are connected on the same network. This I do using php, html and javascript in tests I did with xampp and changing the ports showed me the image well, but now I do not know how to do it so that they are shown since the page is located on the server.
The php that gets me the images of the server is the following ...
$ruta_img = "\\ipservidor\imagenes\imagenes_hoy\imagen1.png";
$imagen = base64_encode(file_get_contents($ruta_img));
and this happened to a javascript function that is responsible for showing it in the section that I require.
function mostrarImagenes(imagen1, imagen2) {
document.getElementById('imgOne').setAttribute('src', 'data:image/jpg;base64,'+imagen1);
document.getElementById('imgTwo').setAttribute('src', 'data:image/jpg;base64,'+imagen2);
}
I do not use any framework is common php.