Forums de discussion

How to find the path of image using imageId?

thumbnail
Abhishek Jain, modifié il y a 6 années.

How to find the path of image using imageId?

Regular Member Publications: 226 Date d'inscription: 20/08/16 Publications récentes
I am using liferay DXP. I want to ask how to find the path on the file system of the server where the image gets stored using imageId . Actually I want to replace the image with a new one during image file uploading. In this case only the imageId of the previous image is known. Please help..any help would be appreciated.
thumbnail
Olaf Kock, modifié il y a 6 années.

RE: How to find the path of image using imageId?

Liferay Legend Publications: 6403 Date d'inscription: 23/09/08 Publications récentes
Abhishek Jain:
I am using liferay DXP. I want to ask how to find the path on the file system of the server where the image gets stored using imageId . Actually I want to replace the image with a new one during image file uploading. In this case only the imageId of the previous image is known. Please help..any help would be appreciated.


Rethink this question. Where (or if) the file is on disk depends on the configured data store. It might be on disk, it might be in the database, or in S3 or in any number of other locations. Thus, there's no proper way to "replace" an image based on a file's location on disk. This is just the same answer as asking for a documentation for the database structure in order to change its content: Do not go there.

Plus, the images (in the case of images most likely only its metadata) might already be indexed.

Use the API and intercept any of the operations that change content, process the content and optionally replace it with yours.
thumbnail
Abhishek Jain, modifié il y a 6 années.

RE: How to find the path of image using imageId?

Regular Member Publications: 226 Date d'inscription: 20/08/16 Publications récentes
Thanks Olaf.. I will use the API then.
I have one more related question- I am using ImageLocalServiceUtil.updateImage() and DLFileEntryLocalServiceUtil.addFileEntry() methods for adding image. I want to ask -is there any relation between the two tables-image and dlfileentry which I have to maintain during updating images. Please help me ..