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

Asset direct link is downloading not open asset on new tab

otavios60241350
Level 2
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
smacdonald2008
Level 10
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.

smacdonald2008
Level 10
Level 10

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

otavios60241350
Level 2
Level 2

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

anudeepyeleti
Level 1
Level 1

Hi Donald,

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

ashu4pma
Level 4
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.

anudeepyeleti
Level 1
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.

smacdonald2008
Level 10
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"

ashu4pma
Level 4
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...

otavios60241350
Level 2
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?

ashu4pma
Level 4
Level 4

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

Lokesh_Shivalingaiah
Community Advisor
Community Advisor

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.

Ravi_S
Level 2
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?

ignacio_mancill
Level 2
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?

arvindp66202646
Level 2
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.

 

ravim10791202
Level 1
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??

Riju-Mahna
Level 3
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.

vik-kim
Level 1
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).

samikshaa223429
Level 3
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.