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

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?

0 Replies

Avatar

Level 1

I fixed this issue by adding the following code on my dispatcher .conf file.

 

<LocationMatch "\.(?i:txt)|(?i:pdf)|(?i:xml)$">
Header set Content-Disposition inline
</LocationMatch>

 

It will open the txt, pdf and xml file on the browser itself.