View previous topic :: View next topic |
Author |
Message |
Myselfsama -
Joined: 22 Jul 2009 Posts: 3
|
Posted: Wed Jul 22, 2009 12:29 am Post subject: Linking to Local files |
|
|
Hello, I'm a new user to the Abyss web server. I have got everything set up and working. The use I want to give it now however, is to have the index.html page display a directory or a list of links that will allow you to download local files from PC.
Example:
you open up browser and type in http://192.168.1.102 (default port 80 so need not be specified). Default index.html page loads up. Now from this point I want to display links to local files on the server that can be downloaded. I searched google extensively but because the files are not within the same directory as the original index.html file I do not know how to do this.
Ive tried 2 different kinds of links which both work on the server PC, but they do not work on PCs connecting remotely.
<a href="C:\Test\index.html"> Click Here </a>
<a href="../../../Test/index.html">return to home</a>
Any help is greatly appreciated,
Myself
ps. Both links work with IE 8.0, only second link works with Mozilla 3.0.11 |
|
Back to top |
|
|
aprelium-support -
Joined: 20 Feb 2009 Posts: 356
|
Posted: Wed Jul 22, 2009 11:09 am Post subject: Re: Linking to Local files |
|
|
Myselfsama,
If you are using default settings, your Documents Path (The path of the web site files) is the "htdocs" folder path. If it is a relative path then it is considered as a subpath of the server root. It is the same as "c:\" for your disk.
So if you want that remotely connected users access you files, they must be in the "htdocs" folder (copy the "test" folder in the "htdocs" one) and your url should not be:
Code: | <a href="C:\Test\index.html"> Click Here </a> |
but :
Quote: | <a href="/test/index.html"> Click Here </a> |
Remotely users can't have a direct access to you "c:\" but only to you server root !!
If you want to use another folder in you local drive but you don't want to copy it in the "htdocs" folder, then you will have to create an alias for that folder.
We strongly recommend you reading the following articles:
http://www.aprelium.com/data/doc/2/abyssws-win-doc-html/hosts-add.html
http://www.aprelium.com/data/doc/2/abyssws-win-doc-html/hosts-configuration.html#HOSTS-ALIASES _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
Myselfsama -
Joined: 22 Jul 2009 Posts: 3
|
Posted: Thu Jul 23, 2009 12:18 am Post subject: |
|
|
Right, my root file is in htdocs. I was using the index.html in htdocs to create a link or redirect to another index.html located in C:\test\.
I'm currently using the webserver X1 so I dont have the option of adding more hosts (which I dont think I need)
I added an alias with virtual path of /test and Real path of C:\test\, modified the link to read:
<a href="/test/index.html">
It seems to be working :D Thanks for the help and very handy info!
~Myself
ps. Out of curiosity, I noticed that the link doesnt work on the Server PC, but works on remotely connected pcs, (not really a problem since the Server PC can access the files directly) but its sort of like it doesnt see its own virtual path. |
|
Back to top |
|
|
aprelium-support -
Joined: 20 Feb 2009 Posts: 356
|
|
Back to top |
|
|
DonQuichote -
Joined: 24 Dec 2006 Posts: 68 Location: The Netherlands
|
Posted: Thu Jul 23, 2009 4:17 pm Post subject: Or use a scripting language |
|
|
As an alternative, you could use a script that serves a file from an otherwise unreachable location. This is done with a lot of web sites. For instance, on a public photo site, it would be bad if anybody could download all photos marked as "restricted to a group of users". So it has a script that checks if you are logged in and checks if you have a right to download that foto. If not, it issues an error (HTTP error "forbidden"). If all is OK, it serves the content.
This off course requires the knowledge of a server-side scripting language (PHP for example), but it gives you much more control than a publicly available download directory. |
|
Back to top |
|
|
Myselfsama -
Joined: 22 Jul 2009 Posts: 3
|
Posted: Thu Jul 23, 2009 6:28 pm Post subject: |
|
|
Pretty awesome ideas, my current set up is all intranet though. Since I dont want these to be public files on the internet Ive only set up it up so local users in my network can access them. I have a tunnel set up on my router though, so if need be I can have someone connect remotely and still access our local resources. :) |
|
Back to top |
|
|
aprelium-support -
Joined: 20 Feb 2009 Posts: 356
|
Posted: Fri Jul 24, 2009 4:45 pm Post subject: |
|
|
Myselfsama wrote: | Pretty awesome ideas, my current set up is all intranet though. Since I dont want these to be public files on the internet Ive only set up it up so local users in my network can access them. I have a tunnel set up on my router though, so if need be I can have someone connect remotely and still access our local resources. :) |
The following PHP web tools may be useful for you:
http://philer.sourceforge.net/
http://www.dmanager.org/ _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|