Close

Attachment open in Browser instead that download

webnopweblink
2 years ago
#21890 Quote
Avatar
  • 2
Dear Everyone,
I have this problem. We would prefer that the link in the frontend created by the Nop Attachment plugin would generate a (PDF in our case) file to be opened in the browser if possibile (and not downloaded).
I noticed that it's downloaded because in the HTTP response headers there is "content-disposition: attachment;", and in order to be opened in browers it should be "content-disposition: inline;".
Is there by any cache a way to do it?

Best Regards
todor.atanasov
2 years ago
#21896 Quote
Avatar
  • Moderator
  • 249
webnopweblink wrote:
Dear Everyone,
I have this problem. We would prefer that the link in the frontend created by the Nop Attachment plugin would generate a (PDF in our case) file to be opened in the browser if possibile (and not downloaded).
I noticed that it's downloaded because in the HTTP response headers there is "content-disposition: attachment;", and in order to be opened in browers it should be "content-disposition: inline;".
Is there by any cache a way to do it?

Best Regards


Hi,

Thank you for reaching out!

You may edit the \Plugins\SevenSpikes.Nop.Plugins.Attachments\Views\_RenderAttachment.cshtml file by changing the target HTML attribute value to _blank

target="_blank" will force the browser to open a new tab.
Best regards,
Todor Atanasov
Nop-templates.com
IntactCliqxTeam
5 months ago
#22376 Quote
Avatar
  • 4
Hi
I just tried that fix and doesn't seem to work so wondering if anything has changed in the more recent versions of NOP?
I'm trying it on NOP version 4.5