Author Topic: invalid link  (Read 65 times)

0 Members and 1 Guest are viewing this topic.

Offline username1565

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

Offline username1565

  • Occasional poster
  • *
  • Posts: 13
    • View Profile
Re: invalid link
« Reply #1 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.
« Last Edit: December 05, 2018, 02:31:06 AM by username1565 »

Offline bmartino1

  • Tireless poster
  • ****
  • Posts: 797
  • I'm only trying to help i mean no offense.
    • View Profile
    • none - google translate
Re: invalid link
« Reply #2 on: December 09, 2018, 07:26:23 PM »
I also think define the mimetype might fox this before HTML code is required
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1