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

#   secured file outside public\_html ?

##

- **[alain.roger](/forum/user/5399-alain-roger "View alain.roger's Profile")**
- [![alain.roger's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar5399.png)](/forum/user/5399-alain-roger "View alain.roger's Profile") Topic Author
- [ Offline](/forum/user/5399-alain-roger)

Less More

- Posts: 192
- Thank you received: 1
-
-
- [](http://www.korcule-kolieska.sk)
-

13 years 5 months ago [\#108675](#108675) by [alain.roger](/forum/user/5399-alain-roger "View alain.roger's Profile")  *[secured file outside public\_html ?](/forum/4-how-to/83590-secured-file-outside-public-html#108675 "Hi,  i would like to know:  1. what is the php code/script responsible to secure virtual product files outside the site's root (so outside public&#95;html) ?  2. how authentification/autorization is checked later on when a user paid for downloading this file ?  3. how file is retrieved from this secured place and how customer gets it ?  thx")* was created by *[alain.roger](/forum/user/5399-alain-roger "View alain.roger's Profile")*

Hi,

i would like to know:

1. what is the php code/script responsible to secure virtual product files outside the site's root (so outside public_html) ?

2. how authentification/autorization is checked later on when a user paid for downloading this file ?

3. how file is retrieved from this secured place and how customer gets it ?

thx

---

*What does not kill you, makes you stronger.*

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgzNTkwLXNlY3VyZWQtZmlsZS1vdXRzaWRlLXB1YmxpYy1odG1sP3RtcGw9bWFya2Rvd24=) 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: 86587
- Thank you received: 14325
-
-

13 years 5 months ago [\#108678](#108678) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[secured file outside public\_html ?](/forum/4-how-to/83590-secured-file-outside-public-html#108678 "Hi,  i would like to know:  1. what is the php code/script responsible to secure virtual product files outside the site's root (so outside public&#95;html) ?  2. how authentification/autorization is checked later on when a user paid for downloading this file ?  3. how file is retrieved from this secured place and how customer gets it ?  thx")*

Hi,

1. There is no code for that. Once the files are outside the public_html folder, the files are secured automatically as no one can access them directly since apache won't give access to them for HTTP requests. In a way, you could say that it's apache which is responsible for that but it's a bit of a stretch.

2. and 3. The user has to be logged in. When the user then click on the download link, HikaShop will verify that the logged in user has a confirmed order for the product of the file he is trying to download, then, it will load the file in memory via the direct hard drive file access functions of PHP and send the file data to the browser of the user as a download.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgzNTkwLXNlY3VyZWQtZmlsZS1vdXRzaWRlLXB1YmxpYy1odG1sP3RtcGw9bWFya2Rvd24=) 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.048 seconds

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