Skip to main content

secured file outside public_html ?

13 years 4 months ago #108675 by alain.roger
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 or Create an account to join the conversation.

13 years 4 months ago #108678 by nicolas
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 or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum