PDF from dispatchers should open in browser without direct download

Avatar

Avatar
Validate 10
Level 4
umamaheswariy46
Level 4

Likes

17 likes

Total Posts

144 posts

Correct reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 10
Level 4
umamaheswariy46
Level 4

Likes

17 likes

Total Posts

144 posts

Correct reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile
umamaheswariy46
Level 4

01-11-2018

Hi Team,

The requirement is we suppose not to download the PDF from dispatchers, it should open in the browser.

What are the configurations for this in dispatchers? Please advise.

Thanks

Uma

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

140 likes

Total Posts

543 posts

Correct reply

165 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile

Avatar
Validate 25
MVP
PuzanovsP
MVP

Likes

140 likes

Total Posts

543 posts

Correct reply

165 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Contributor 2
Ignite 10
View profile
PuzanovsP
MVP

02-11-2018

Dear Uma,

 

If you could try to add following command to your .conf file, it would resolve issue:

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

</LocationMatch>

 

Regards,

Peter

 

 

Another Reply:

Finally we are able to open in tab for specific folder PDF's of specific site dispatcher file <Directory "/usr/local/pmc/var/www/html/content/dam/site/specificfolde/"> <FilesMatch "\.(pdf)$"> Header set Content-Disposition "inline" Header set Cache-Control "max-age=86400, public" Require all granted </FilesMatch> </Directory>

Answers (5)

Answers (5)

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

02-11-2018

Excellent response Peter!

Avatar

Avatar
Boost 1
Level 1
raju_komari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
raju_komari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
raju_komari
Level 1

25-08-2020

Finally we are able to make specific folder pdf's open in tab itself , below is the site configuration in dispather level.

 

<Directory "/usr/local/pmc/var/www/html/content/dam/site/specificfolder/">
<FilesMatch "\.(pdf)$">
Header set Content-Disposition "inline"
Header set Cache-Control "max-age=86400, public"
Require all granted
</FilesMatch>
</Directory>

Avatar

Avatar
Boost 1
Level 1
raju_komari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
raju_komari
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
raju_komari
Level 1

25-08-2020

HI Peter,

As per the suggestion from you,  below regular expression will open all pdf files in new tab irrespective of dam path, this fine.

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

</LocationMatch>

 

But, if want to down load specific dam path pdf file then what is the regular expression.

example: open all pdf's in new tab for this site specific dam path if we have more sites content in dam.

ex: /dam/abcproject/allbooks/(1-100 pdf files)

<LocationMatch "\.(?i:pdf)$">

 

Kindly do the needful, Thank you.

 

Avatar

Avatar
Give Back
Level 1
charityh8448708
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile

Avatar
Give Back
Level 1
charityh8448708
Level 1

Likes

2 likes

Total Posts

4 posts

Correct reply

0 solutions
Top badges earned
Give Back
Boost 1
View profile
charityh8448708
Level 1

13-04-2020

You might as well add these as well while you are there. I put all mine in a new /conf.d/rewrites/mod_locationmatch.rules file --

<LocationMatch "\.(?i:xml)$">
ForceType text/xml
Header set Content-Disposition inline
</LocationMatch>
<LocationMatch "\.(?:gif|jpe?g|png)$">
ForceType image
Header set Content-Disposition inline
</LocationMatch>

 

Avatar

Avatar
Validate 10
Level 4
umamaheswariy46
Level 4

Likes

17 likes

Total Posts

144 posts

Correct reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 10
Level 4
umamaheswariy46
Level 4

Likes

17 likes

Total Posts

144 posts

Correct reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile
umamaheswariy46
Level 4

02-11-2018

Hi Peter,

Thanks , we will try to update these.

Thanks

Uma