AnonymousUser Posted May 31, 2013 Share Posted May 31, 2013 (edited) Is there anyway to change the attachment behavior in PrestaShop? By default, when a PDF is attached to a product, a "Download" tab is made, and the file is downloaded when clicked. I would prefer if instead of downloading, the PDF was opened normally. This way, for people using browsers like Google Chrome, the PDF will open within the browser, and visitors using browsers such as Internet Explorer can download it (or whatever their default browser behavior is set to do). Thanks for any help. Edited July 23, 2013 by AnonymousUser (see edit history) Link to comment Share on other sites More sharing options...
AnonymousUser Posted May 31, 2013 Author Share Posted May 31, 2013 Also, a related question: We have MSDS sheets for several of our products. On the product pages, we just want to call the PDFs "MSDS." However, if we name all of the PDFs "MSDS," then we can't figure out which sheet is which when adding the attachment to the product via the "Available attachments" on the product edit page. Is there anyway to overcome this issue? Link to comment Share on other sites More sharing options...
benzinklubben.dk Posted July 23, 2013 Share Posted July 23, 2013 Same problem, follow Link to comment Share on other sites More sharing options...
AnonymousUser Posted July 23, 2013 Author Share Posted July 23, 2013 Same problem, follow I actually made another post about the same thing about a week after this one, which got answered. assuming you are using PS v1.5.4.1, looks like you simply need to change the AttachmentController.php from header('Content-Disposition: attachment; filename="'.utf8_decode($a->file_name).'"'); to header('Content-Disposition: inline; filename="'.utf8_decode($a->file_name).'"'); It would be best to do this as an override. I'm also not sure how this will react to non-PDF attachments, so you best test them before you release them to the public Here's a link to the thread and the reply: http://www.prestasho...ymous_element_5 Hope it helps! I'll be adding [solved] to the thread title. 3 Link to comment Share on other sites More sharing options...
benzinklubben.dk Posted July 23, 2013 Share Posted July 23, 2013 If this works I'll serve you lunch in Copenhagen any day :-) 1 Link to comment Share on other sites More sharing options...
benzinklubben.dk Posted July 23, 2013 Share Posted July 23, 2013 I was also thinking, can you attach the pdf to the order confirmation email? Link to comment Share on other sites More sharing options...
Recommended Posts