Prevent image from auto download

Avatar

Avatar
Applaud 25
Level 2
Shaheena_Sheikh
Level 2

Likes

2 likes

Total Posts

97 posts

Correct reply

1 solution
Top badges earned
Applaud 25
Applaud 5
Affirm 1
Validate 10
Validate 1
View profile

Avatar
Applaud 25
Level 2
Shaheena_Sheikh
Level 2

Likes

2 likes

Total Posts

97 posts

Correct reply

1 solution
Top badges earned
Applaud 25
Applaud 5
Affirm 1
Validate 10
Validate 1
View profile
Shaheena_Sheikh
Level 2

17-02-2021

When I open the link below, the image download automatically. I wanted to prevent the image from downloading and wanted it to load on the browser, so I unchecked the checkbox in Apache Sling Content  Disposition Filter for the field Enable For All Resource Paths. But even if I add content/*:image/jpg to Included Resource Paths & Content Types, the image still gets downloaded. I also tried by adding the absolute image path to Excluded Resource Paths, the image still gets downloaded. How can I prevent it?


http://localhost:4502/content/dam/v-foundation.jpg

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

140 likes

Total Posts

188 posts

Correct reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile

Avatar
Give Back 3
MVP
Manjunath_K
MVP

Likes

140 likes

Total Posts

188 posts

Correct reply

61 solutions
Top badges earned
Give Back 3
Give Back
Boost 50
Boost 5
Boost 3
View profile
Manjunath_K
MVP

21-02-2021

@Shaheena_Sheikh 

Keep "Enable For All Resource Paths" checked which is by default checked for security feature against XSS attacks.

 

If any specific one or two files for which you want to prevent/exclude adding header "Content-Disposition : attachment"  then include that resource path(complete path of original rendition as mentioned below) in "Excluded Resource Paths", for these excluded resource paths "Content-Disposition : attachment" won't be set & which can be viewed in browser without download.

 

/content/dam/v-foundation.jpg/jcr:content/renditions/original

 

contentheader.png

 

Hope this helps!

Answers (0)