Foren

How to access external images in portlet from filesystem ?

Gaurav kalia, geändert vor 11 Jahren.

How to access external images in portlet from filesystem ?

New Member Beiträge: 14 Beitrittsdatum: 13.08.12 Neueste Beiträge
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, geändert vor 11 Jahren.

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

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
Access the image using it's url in your portlet.
Gaurav kalia, geändert vor 11 Jahren.

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

New Member Beiträge: 14 Beitrittsdatum: 13.08.12 Neueste Beiträge
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, geändert vor 7 Jahren.

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

New Member Beiträge: 3 Beitrittsdatum: 09.05.16 Neueste Beiträge
I am facing same issue. Can some help me out plz.....
thumbnail
Olaf Kock, geändert vor 7 Jahren.

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

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
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.