kim de castro
kim de castro

Reputation: 309

How to access source/upload files in other drive (xampp)?

Is it possible to access the site in htdocs and get the source or upload pdf/images(gif/png) in other drives?

example: (C:)still running on htdocs

localhost/test/index.php

(f:) images/pdf stored in F: drive.

f:/test/images/foo.jpg

Upvotes: 0

Views: 3039

Answers (2)

kim de castro
kim de castro

Reputation: 309

solved it using this steps:

Add folder name "alias" in :

C:\xampp\apache\conf\

after adding alias folder add this in "httpd.conf" at the bottom and save it.

Include "conf/alias/*"

Now create *alias.conf" and save it to alias folder:.

<directory "c:\TEST">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #     Order allow,deny
    Allow from all
</Directory>

Alias /test "C:\TEST"

Upvotes: 1

jineesh MG
jineesh MG

Reputation: 61

Apache should have the access right to the folder. Best way is to store any file inside htdocs folder which is relative to you webroot folder.

You will get the document root using the server variable

$_SERVER["DOCUMENT_ROOT"]

Thanks MG

Upvotes: 0

Related Questions