Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Uploading assets using file upload

Karl515
Level 5
Level 5

I'm uploading assets using

1706762_pastedImage_0.png

But how can I make the uploaded file display?

my Properties

1706763_pastedImage_1.png

I've done a little research so I know that they created files under my components

1706764_pastedImage_2.png

But how can I retrieve that files?

Thanks!

3 Replies
Arun_Patidar
Community Advisor
Community Advisor

Hi,

Please check OOTB or core image component implementaion. you need to check wether image is local or from DAM. And accordingly you need to include.

/libs/wcm/foundation/components/image/image.js

aem-core-wcm-components/ImageImpl.java at master · adobe/aem-core-wcm-components · GitHub 

Karl515
Level 5
Level 5

Hello there.

Thanks for the answer.

I'm trying to create multiple fields in the same component like this

1709747_pastedImage_0.png

But the problem is both file field only reads file under

/content/

1709748_pastedImage_1.png

if I rename the 1709749_pastedImage_2.png to file2, yes it creates file2 under /content/ but it only reads "file".

So if I put something in the first field, it also reflects in all image fields, cause they all read the same "file" under /content/

how can I make one image field read file, anothe image field read file2. and so on.

Arun_Patidar
Community Advisor
Community Advisor

Hi,

It is because of below line of code in image.js-

// check if there's a local file image under the node

    granite.resource.resolve(granite.resource.path + "/file").then(function (localImageResource) {

Can you try to modify your dialog and save image under item node

e.g. name=./item/file

To achieve this you may need to use java but you can try above.