Fórum

How to access external images in portlet from filesystem ?

Gaurav kalia, modificado 11 Anos atrás.

How to access external images in portlet from filesystem ?

New Member Postagens: 14 Data de Entrada: 13/08/12 Postagens Recentes
Hi All

I have a requirement to display external images from the physical location in portlet.

I am querying to the database which returns me the path and the image names lying on the physical location.

Can anyone please guide me how can I achieve this.

Thanks
Gaurav
thumbnail
Hitoshi Ozawa, modificado 11 Anos atrás.

RE: How to access external images in portlet from filesystem ?

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
Access the image using it's url in your portlet.
Gaurav kalia, modificado 11 Anos atrás.

RE: How to access external images in portlet from filesystem ?

New Member Postagens: 14 Data de Entrada: 13/08/12 Postagens Recentes
Hi Hitoshi

Thanks for the reply.

But I am not able to access the images directly because if I give the absolute path of the location, it will get appended with the server URL "http:/l/ocalhost:8080".

For example:

I have images available on location say "/home/image/test.jpg" and when I try to access the image using this path it will become like "http://localhost:8080/home/image/test.jpg" which is not right.

Can you please suggest if i am doing something wrong.

Thanks
Gaurav
Sateesh Kumar, modificado 7 Anos atrás.

RE: How to access external images in portlet from filesystem ?

New Member Postagens: 3 Data de Entrada: 09/05/16 Postagens Recentes
I am facing same issue. Can some help me out plz.....
thumbnail
Olaf Kock, modificado 7 Anos atrás.

RE: How to access external images in portlet from filesystem ?

Liferay Legend Postagens: 6403 Data de Entrada: 23/09/08 Postagens Recentes
Sateesh Kumar:
I am facing same issue. Can some help me out plz.....


Luckily you can't access random files on webservers, only those that the webserver explicitly publishes through http. Would you like your /etc/passwd to be readable to everyone on the web? You'll have to publish these files somewhere - and when you did this, you'll know their URL.