Friedrich Roell
Friedrich Roell

Reputation: 457

Lampp/Apache - Make files not available from htdocs folder via HTTP

i have lampp installed on my maschine with apache. I dont even know if that is relevant for my question...

i am trying to create a way (php, html) for users (from my website) to download files which are not inside the htdocs folder is that possible? the reason i want to know this is, that i don't want anyone else to have access to those files by just typing in the url of the file.

cheers, Friedrich

Upvotes: 0

Views: 435

Answers (3)

Wrikken
Wrikken

Reputation: 70460

Several options, the least load is probably X-Sendfile

Upvotes: 0

TheTechGuy
TheTechGuy

Reputation: 17354

yes, you can, as many as you want.

Open the file [xamp_installation_folder]/apache/conf/httpd.conf in any text editor.Copy below lines after the htdocs element after changing the directory to your own folder.

<Directory "C:/path/to/your/folder">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Then search for this string: . Inside that element, add a new alias as followed:

Alias /yoursite/ "C:/path/to/your/folder/yoursite/"
Save the file and restart the XAMPP server.

Complete link is here

Upvotes: -1

Aerik
Aerik

Reputation: 2317

Take a look at this: http://php.net/manual/en/function.fpassthru.php

Upvotes: 2

Related Questions