Reputation: 457
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
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.
Upvotes: -1
Reputation: 2317
Take a look at this: http://php.net/manual/en/function.fpassthru.php
Upvotes: 2