rejetto forum

Software => HFS ~ HTTP File Server => Bug reports => Topic started by: username1565 on December 04, 2018, 08:33:24 PM

Title: invalid link
Post by: username1565 on December 04, 2018, 08:33:24 PM
Need to add fullpath to the link, because path not full, relative and invalid.

1. Run HFS server.
2. Add some "folder" with files there.
3. Go to http://IP:PORT/folder/ - there is the files inside the folder.
4. Open the source code of HTML-page with that response:
and see this:
Code: [Select]
<a href="file1.txt"><img src="/~img47"> file1.txt</a>"file1.txt" - this is relative path for http://IP:PORT/folder/ where this page is generated, and this is - incorrect link.

Need to insert there fullpath:
Code: [Select]
<a href="http://IP:PORT/folder/file1.txt"> file1.txt </a>
HOW TO DO THIS?
I don't know syntax of macroses...

P.S.: I did add there an index.html with the links to all files,
and this seems good with fullpathes... But this is not dynamic page...
Title: Re: invalid link
Post by: username1565 on December 05, 2018, 02:29:22 AM
Solved!
Found solve in this thread: http://rejetto.com/forum/index.php?topic=4049.0
and here: http://www.rejetto.com/wiki/index.php/HFS:_URL_parameters
Quote
~files.lst
inserts HTML from filelist.tpl if exists in hfs.exe folder, otherwise produces ASCII file list of the requested folder

To get list with URLs:
1. Create filelist.tpl
2. Write this code there:
Code: [Select]
%files%

[files]
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
%list%
</trackList>
</playlist>

[file]
<track>
<a href="http://%host%%encoded-folder%%item-url%">http://%host%%encoded-folder%%item-url%</a><br>
</track>
3. Run HFS, add folder with files there (if still not added).
4. Go to http://IP:PORT/folder/?search=.png&rev=1&sort=t
Now there is links lists with full path in the href.
Fullpath URL is the main path to file on the server.
And no any relative pathes in response links.

Best regards.
Title: Re: invalid link
Post by: bmartino1 on December 09, 2018, 07:26:23 PM
I also think define the mimetype might fox this before HTML code is required