Project

General

Profile

Manipulating document root or...?

Added by Przemysław Szczygielski over 14 years ago

Hello,

I would like to implement a simple file server based entirely on http protocol (similar to HFS - see http://www.rejetto.com/hfs/ which is unfortunately Delphi/Windows only). All I want to achieve is run such http server on my home PC and be able to download files via web browser anywhere. Filetree example from wt source does just that out of the box. The problem is I would have to set docroot on command line to something like "/" to have access to entire filesystem, which is a bit... too much. I would rather have some config that would tell the server which directories should be accessible this way, but how can I do this? Can I move docroot around? Or add some virtual root to point to a specific path on my PC?

Sorry if I am asking about something obvious, but I have really no experience with http servers...


Replies (1)

RE: Manipulating document root or...? - Added by Wim Dumon over 14 years ago

Hi,

The easiest is probably to use a WFileResource, which allows you to serve a file that is not inside the docroot directory. This is still secure as the file is only accessible by the session for which you created the WFileResource.

Best regards,

Wim.

    (1-1/1)