Forums

Home » Liferay Social Office

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jagir Buch
IMG TAG NOT WORKING
May 13, 2014 6:52 AM
Answer

Jagir Buch

Rank: New Member

Posts: 11

Join Date: March 27, 2014

Recent Posts

Hi all,
My Requirement is displaying image from the current local drive to liferay Portlet
I search and come to know that you shoule put your image in docroot folder and then display image from that which is working
but i want to use img tag for preview image which is selected by user..so in that case i can't first copy image in docroot & then display from it.
because it is not convinent

Please reply me as soon as possible
David H Nebinger
RE: IMG TAG NOT WORKING
May 13, 2014 12:00 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11305

Join Date: September 1, 2006

Recent Posts

The <img /> tag will only display from a URL available, and normally you'll use something from your docroot directory.

If you're talking about Liferay images, though, they get uploaded into the Image Gallery and are displayed from there.

Are you asking about how to use the image gallery?
Jagir Buch
RE: IMG TAG NOT WORKING
May 15, 2014 3:17 AM
Answer

Jagir Buch

Rank: New Member

Posts: 11

Join Date: March 27, 2014

Recent Posts

Thank you sir for your reply
Exactly sir your guess is correct..
I am asking how to use image gallery??
because i want to display image to user before storing that image to database..
Oliver Bayer
RE: IMG TAG NOT WORKING
May 15, 2014 6:20 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi Jagir,

if I get you right you're trying to display an image before even upload it right? This can't be possible at all.

In Liferay as soon as you click at the "upload" button inside the document library (or image library respectively) the image is getting uploaded and saved to the database instantly.

You can -of course- code a custom solution (hook or portlet plugin) to add an additional second step to show the preview images or use some javascript solutions to achieve this. But all the images have to be loaded in advance before you can show them, you can't access the local hard drive directly.

HTH Oli
Jagir Buch
RE: IMG TAG NOT WORKING
May 16, 2014 5:08 AM
Answer

Jagir Buch

Rank: New Member

Posts: 11

Join Date: March 27, 2014

Recent Posts

Thank you...i m getting my answer