Foren

IMG TAG NOT WORKING

Jagir Buch, geändert vor 9 Jahren.

IMG TAG NOT WORKING

New Member Beiträge: 11 Beitrittsdatum: 28.03.14 Neueste Beiträge
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
thumbnail
David H Nebinger, geändert vor 9 Jahren.

RE: IMG TAG NOT WORKING

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
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 Vimalbhai Buch, geändert vor 9 Jahren.

RE: IMG TAG NOT WORKING

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

RE: IMG TAG NOT WORKING (Antwort)

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
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 Vimalbhai Buch, geändert vor 9 Jahren.

RE: IMG TAG NOT WORKING

New Member Beiträge: 11 Beitrittsdatum: 28.03.14 Neueste Beiträge
Thank you...i m getting my answer