Close

Attachment open in Browser instead that download

webnopweblink
one year 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
one year 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