Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Asset direct link is downloading not open asset on new tab

Avatar

Level 2

Hi, I have a file on this path http://localhost:4502/assetdetails.html/content/dam/we-retail/en/activities/hiking/hiking_5.jpg,​ when I try to access the file by direct link like this: http://localhost:4502/content/dam/we-retail/en/activities/hiking/hiking_5.jpg the file is download but It should open on browser windows not do download direct.  What are happening? The response header might be wrong how can I fix it?

21 Replies

Avatar

Level 10

This is confirmed - on AEM 6.2 - the URL opened the image in the browser. In AEM 6.4 - it downloads the file. Checking to see if this is normal behavior or a bug.

Thanks smacdonald2008​, please let me know if you have any update about it.

Avatar

Level 10

Our support team is investigating this. I will post back what they say.

Avatar

Level 2

Sorry, I don't understand, the support team is not investigating?

Avatar

Level 1

Hi Donald,

Is there any update on this. I observe the same behavior in 6.4 as well.

Avatar

Level 4

I didn't get this, What update exactly you are looking for? As I have mentioned in first reply, it is a security request filter at sling level responsible for this, uncheck the option (Enable Content Disposition for all paths) at filter takes you to the old behavior. It is a not a bug rather security improvement.

Avatar

Level 1

I was looking for the possible reason for the assets being downloaded rather than being displayed in the browser in AEM 6.4 .

I have observed this with all the images and  this was never the case with AEM 6.1 .

I did look at the Enable Content Disposition for all paths option in Apache Sling Content Disposition Filter, but I do not see any differences between AEM 6.1 and 6.4 at a quick glance.

The Enable Content Disposition for all paths option is always checked by default.

Why is it that it needs to be unchecked to expect the old behavior while it is not recommended to uncheck this option.

I would like to know if there is more to this and just this option in content disposition filter.

Avatar

Level 10

As our Adobe Team member stated - is a sling security option - that is all.

"it is a security request filter at sling level responsible for this"

Avatar

Level 4

This was a security fix at Sling level, the disposition filter has been added to force this behavior. See [0].

To undo this behavior (not recommended), you can disable the component[1].

Thanks

[0] SLING-4883Extend content disposition filter protection to jcr:data

[1] org.apache.sling.security.impl.ContentDispositionFilter

[2] http://10.42.36.65:4502/system/console/components/org.apache.sling.security.impl.ContentDispositionF...

Avatar

Level 2

So, ashu4pma​, what you recommend to do? I need have a direct link for a .mp4 video  hosted on /content/dam for exemplo and it should play direct browser like this https://www.w3schools.com/html/mov_bbb.mp4, just disable the Content Disposition Filter?

What happend if I just uncheck "Enable For All Resource Paths", will it have any side effects?

Avatar

Level 4

Yes uncheck the checkbox(Enable Content Disposition for all paths).

Hi,

Ideally you should use any of the players like HTML5 player to render your video on the browser. when someone access an asset (including video) directly then ideal behavior is to download.

Avatar

Level 2

Circling back to this thread here. PDF's are downloading on to a local browser. Updating/Disabling the disposition filters are not helping either? What else do i need to do?

Avatar

Level 2

Any update here?

I tried to add a robots.txt and it is being downloaded yet. I know that there are different ways to show a robots.txt but the simpliest way is to put in the dam and just configure a rule mapping, but this easiest way does not work because this issue.

Does anyone has solved it?

Avatar

Level 2

Dear Team,

 

I am facing same issue in AEM 6.5 (without any service packs). I tried all possible tricks with Content Disposition filter like check/uncheck flag , putting proper values in included resource paths , but still it downloads my video assets rather than streaming in browser.

I am referring video assets through direct DAM link .

 

May I request if someone can be able to help me out here .

 

Thanks in advance.

 

Avatar

Level 1

We recently upgraded from 6.3 to 6.5 and facing the same issue. The pdf files, robot.txt and sitemap.xml were opening on the browser window on 6.3 version is downloading the files on 6.5 version. I have tried unchecking the "Enable For All Resource Paths" on the content disposition filter and also added the absolute path on "Included Resource Paths & Content Types" fields. Nothing works. Does anyone have solution??

Avatar

Level 3

I used the solution for PDF's from this thread. It works only via a dispatcher, though. But it works like a miracle.

https://experienceleaguecommunities.adobe.com/t5/Adobe-Experience-Manager/PDF-from-dispatchers-shoul...

 

The Disposition Filter in AEM is pretty useless (and pathetic) for all these scenarios. Not sure what is the purpose of that filter.

Avatar

Level 1

Thanks! I finally found a solution for robots.txt issue. Actually it works for all types of assets, just need to change pdf to your format (e.g. txt, png, mp4, etc).

Avatar

Level 3

hi @vik-kim 

I am facing an similar issue with DAM PDFs links getting downloaded instead of opening directly on browsers. Can you provide details of the solution that worked for you ?

Thanks in advance.

Samiksha.