PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Firstly that would not work for people not directly on your machine or network, if that. The link is searching for E:\Directory\File on each person's system not on the server. (I'm a bit confused over why you are doing this )
I think the only solution is to have the file in the root and above :S
I am sure it is possible, just might be a tad complicated
My 2 cents
Last edited by John Cartwright on Mon Feb 09, 2004 2:41 pm, edited 1 time in total.
the reason i want to do this is i have to many files to fit on my c drive so i need to link to files on another drive
there must be a way to set up my e: drive or any other drive as a virtual directory
if I use an ftp can i link to the file from a php page without leaving my web page and going into the ftp. sorry if that doesnt make sense I know nothing about ftp's
First iw ould get an FTp server, and then from there its pretty much self explanitory! There are a lot of FTp servers out there, jsut search google for some!! I dont kow fi you'll find any for free though
I think you can use Alias and <Directory> within <IfModule mod_alias.c> in your apache configuration file (httpd.conf) or through .htaccess file. Alias can be used to make an alias for a directory you specified then your can control how user access your alias directory by using <Directory>. For further reading, you can read apache manual.
Note: apache's syntax used here based on Apache 1.3.xx. I don't know if there's any differences with 2.0.xx.
Ok I got this sussed now so I'll share it with you its very simple when you know how. If you want to access files from a drive or folder outside your websites root this is how you do it. assuming your using apache
Open your apache folder and click on folder conf open httpd.conf in a text editor and find
Alias /icons/ "C:/Fireserv/apache/icons/"
<Directory "C:/Fireserv/apache/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
then after add
Alias /dir name "E:/"
<Directory "E:/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
this one is set to access my E: drive make the changes below to suit your needs
replace dir name with anything you want then in the quotes type the drive or folder you wish to access and repeat inside the quotes in <Directory "E:/"> save your httpd.conf file always make a backup before you overwrite this file restart your computer so the new config is used and that is that.
now when you want to access a file on your aliased drive/folder
use this format
/dir name/file name
rename dir name to whatever you used in the httpd.conf file and file name to whatever the file your trying to access is called.
If you want to add another alias just repeat what you have just done.
your right mahara
the alias icons is already set in httpd.conf not sure why its there
because www/fireserv is the root dir so not sure if its needed
but you notice on my entry for E: drive the trailing slash is included and works a treat.