[Skip to main content](#vessel-content)

#   Open downloads in browser

##

- **[DavidVogt](/forum/user/40153-davidvogt "View DavidVogt's Profile")**
- [![DavidVogt's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/40153-davidvogt "View DavidVogt's Profile") Topic Author
- [ Offline](/forum/user/40153-davidvogt)

Less More

- Posts: 22
- Thank you received: 1
-
-

6 years 6 months ago [\#318133](#318133) by [DavidVogt](/forum/user/40153-davidvogt "View DavidVogt's Profile")  *[Open downloads in browser](/forum/26-product-category-display/899682-open-downloads-in-browser#318133 "-- Joomla version -- : 3.9.18 -- PHP version -- : 7.2  Hi there, I'm using the &quot;files&quot; section of the product pages to upload PDF manuals for products. My client has asked me to somehow change the browser behavior to open the PDF files in the browser, rather than a file download. Any advice would be greatly appreciated!")* was created by *[DavidVogt](/forum/user/40153-davidvogt "View DavidVogt's Profile")*

-- Joomla version -- : 3.9.18
-- PHP version -- : 7.2

Hi there, I'm using the "files" section of the product pages to upload PDF manuals for products. My client has asked me to somehow change the browser behavior to open the PDF files in the browser, rather than a file download. Any advice would be greatly appreciated!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTk2ODItb3Blbi1kb3dubG9hZHMtaW4tYnJvd3Nlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

6 years 6 months ago [\#318157](#318157) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Open downloads in browser](/forum/26-product-category-display/899682-open-downloads-in-browser#318157 "-- Joomla version -- : 3.9.18 -- PHP version -- : 7.2  Hi there, I'm using the &quot;files&quot; section of the product pages to upload PDF manuals for products. My client has asked me to somehow change the browser behavior to open the PDF files in the browser, rather than a file download. Any advice would be greatly appreciated!")*

Hi,

First, note that this can depend on the browser's settings:
[ apemobile.zendesk.com/hc/en-us/articles/...opening-in-a-new-tab](https://apemobile.zendesk.com/hc/en-us/articles/115001569212-PDF-files-are-downloading-instead-of-displaying-in-web-browser-or-opening-in-a-new-tab)
Second, in the headers sent back to the browser, HikaShop specifies a genertic content-type, and is also doesn't set the content-disposition to inline: [ stackoverflow.com/questions/34891513/vie...stead-of-downloading](https://stackoverflow.com/questions/34891513/view-pdf-file-in-browser-instead-of-downloading)
That's because HikaShop can be used with many different types of files and this is not necessarily wanted.
So in the file administrator/components/com_hikashop/classes/file.php, you'll find this code: Code:

header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . $name . '"');

Changing them to: Code:

header('Content-Type: application/pdf'); header('Content-Disposition: inline; filename="' . $name . '"');

should help but note that it might be an issue if you have other files that aren't PDF files as downloadable files on your products.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTk2ODItb3Blbi1kb3dubG9hZHMtaW4tYnJvd3Nlcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.056 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
