Lamp/Apache-通过HTTP使文件无法从htdocs文件夹中获得


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

我用apache在我的maschine上安装了lampp。我甚至不知道这是否与我的问题有关。。。

我正在尝试为用户(从我的网站)创建一种下载文件的方式(php,html),这些文件不在htdocs文件夹中这可能吗?我想知道这一点的原因是,我不希望其他人只需输入文件的url就可以访问这些文件。

欢呼,弗里德里希

看看这个:http://php.net/manual/en/function.fpassthru.php

几个选项,负载最小的可能是X-Sendfile

是的,你可以,想多少就多少

在任何文本编辑器中打开文件[example_installation_folder]/apache/conf/httpd.conf。将目录更改为您自己的文件夹后,在htdocs元素后复制以下行。

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

然后搜索此字符串:。在该元素中,添加一个新的别名,如下所示:

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

完整的链接在这里