1 votes

How do you create an Image Server?

How can I make an image server? That is, that my images have a URL and instead declare them like this:

 <img src="pic_mountain.jpg" >

Let them look like this:

 <img src="http://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools.com">

With a specific URL of my page or with what programming language or backend can it be done (rubyonrails, django or php)?

If you have an example, I would greatly appreciate it.


Muriano Points 3719

You don't need any special technology to do that which you want.

<img src="pic_mountain.jpg">

This is a path "relative" to indicate that the image is in the same directory as the web document that it is loading, for example index.html. This way, you would have this structure

- Directorio raiz web
-- index.html
-- pic_mountain.jpg

On the contrary:

<img src="http://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools.com">

It is a path to "absolute", represents all of the complete address where is hosted the resource. Includes schema http://, host or server, www.w3schools.com and the path or route /images/w3schools_green.jpg in this way, it is not necessary that the web document and the resource are in the same directory. Not even in the same server.

To do this, you need a web server (apache, nginx, etc) although any of the options that you have commented, such as picassa, you can use. Just keep in mind that when you indicate the attribute src of the image, you'll need to put these three elements that I mentioned to you, esquema o schema, servidor o host and ruta o path.

This is equally applicable to the attribute" href of the links, which can be relative or absolute.


HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by: