rejetto forum

invalid link

0 Members and 1 Guest are viewing this topic.

Offline username1565

  • Occasional poster
  • *
    • Posts: 35
    • View Profile
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...
« Last Edit: December 04, 2018, 09:09:50 PM by username1565 »


Offline username1565

  • Occasional poster
  • *
    • Posts: 35
    • View Profile
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.
« Last Edit: December 05, 2018, 02:31:06 AM by username1565 »


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 911
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
I also think define the mimetype might fox this before HTML code is required
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing