I have a website hosted in LAMP Server.
My Lamp server is installed in a Debian virtual machine.
My virtual machine is hosted in a distant server.
I face a problem when i try to display an image in my website from the distant server. this is an example of the code i am using :
If I really understand your question, you have a linux webserver and you want to embed an image from your server inside a HTML file.
When you wrote
src="\NameOfDistantServer\Directory\MyImage.jpg", you should add slashes instead of backslashes even if most browsers changes them correctly.
Asyour question is a bit unclear, I will show you most used methods of embedding images on a webpage.
1. Specify full URL of the image:
If you want to specify full url, your code should be like this:
2. Specify a relative URL of the image:
If your image is hosted for example, at:
http://example.com/directory/test.png, and you want to print that image still on the same domain (
example.com), you can specify the relative path of the image, not the entire path:
3. Encode images to base64 to not use files
If you don't want to host the image inside a file on your server, you can covert it to
base64 and embed it on your webpage as a code, instead of file url. For this, you can use our service which is converting the image you choose to an encoded image: http://netcreator.us/base64-image-encode