Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
George Smith
Generate a right path
February 26, 2013 3:23 AM

George Smith

Rank: New Member

Posts: 24

Join Date: January 9, 2013

Recent Posts

I save uploaded image files in tomcat or portlet temporary directory, and I want to display them. I know their path in server file system, but how generate a right path for displaying it on portlet's page? It must become from smth like:

to smth like:

How to get it? How to display image from some server directory in portlet?
Hitoshi Ozawa
RE: Generate a right path
February 26, 2013 4:12 AM

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Not sure what you're trying to do. Images are usually saved in portlet's docroot\img directory.

Access it from a portlet as below:

I just wrote an article (unfortunately in Japanese) explaining how to write a simple slide show portlet.
There's a sample code accessing image file in a portlet. It's a little bit down the page. Looking at the code may help you.