PDA

View Full Version : PHP, download from any drive?



James-
04-01-2006, 06:06 PM
My friend scripted in php a well script that could enable to download from anydrive, even though the server root is on the C: drive. I was wondering if you had anything that resembles that, cause my friend won't give it to me and I've tried 3 hours of google searching T.T

Twey
04-01-2006, 06:38 PM
Just symlink (or the equivalent) the file to somewhere under the server root.

James-
04-02-2006, 05:52 AM
symlink? o_O wth is dat @_@ lol, sorry I'm a little new to php =\

Twey
04-02-2006, 11:35 AM
Symbolic link. On *n?x systems, this would be how I'd do it, anyway. Since the option to follow symlinks exists in the Windows version of Apache, I presume there must be an equivalent. Perhaps making a shortcut?

James-
04-02-2006, 02:01 PM
Hmm shortcuts don't work =\, and I saw a function in php that's called Symlink, but don't quite know how to use it o_O

mwinter
04-03-2006, 02:37 AM
Since the option to follow symlinks exists in the Windows version of Apache, I presume there must be an equivalent. Perhaps making a shortcut?I wouldn't bet on it. :) Though shortcuts can be used like symlinks, it doesn't mean that Apache does.

An Apache alternative is to use the Alias directive. This maps a URL path to a directory. For example, with the directive:



Alias /images "D:/My Images"
a request for

  http://www.example.com/images/foo.jpeg

would return the file,

  D:\My Images\foo.jpeg

There are two things to note:


The Alias directive can only be used in the server configuration file, either as a global setting, or within a virtual host section. It cannot be used in access files (.htaccess).
It may be necessary to explicitly grant access to an aliased directory. Continuing the previous example,



<Directory "D:/My Images">
Order Allow,Deny
Allow from all
</Directory>
Mike


P.S. James, sorry for not following up to your other thread. I couldn't find it, for some reason, but it seems like you figured it out.

James-
04-03-2006, 03:41 AM
yeah Apparently a typo makes a big diffrence at the end of doc_root -_-' lol....got an error with what you said then figured out that I had to add an empty folder with the same name ;) hehe