Forums de discussion

How to access external images in portlet from filesystem ?

Gaurav kalia, modifié il y a 11 années.

How to access external images in portlet from filesystem ?

New Member Publications: 14 Date d'inscription: 13/08/12 Publications récentes
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, modifié il y a 11 années.

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

Liferay Legend Publications: 7942 Date d'inscription: 24/03/10 Publications récentes
Access the image using it's url in your portlet.
Gaurav kalia, modifié il y a 11 années.

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

New Member Publications: 14 Date d'inscription: 13/08/12 Publications récentes
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, modifié il y a 7 années.

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

New Member Publications: 3 Date d'inscription: 09/05/16 Publications récentes
I am facing same issue. Can some help me out plz.....
thumbnail
Olaf Kock, modifié il y a 7 années.

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

Liferay Legend Publications: 6403 Date d'inscription: 23/09/08 Publications récentes
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.