Author Topic: invalid link  (Read 1442 times)

0 Members and 1 Guest are viewing this topic.

Offline username1565

  • Occasional poster
  • *
  • Posts: 35
    • 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>
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
Re: invalid link
« Reply #1 on: December 05, 2018, 02:29:22 AM »
Found solve in this thread:
and here:
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]

<playlist version="1" xmlns="">

<a href="http://%host%%encoded-folder%%item-url%">http://%host%%encoded-folder%%item-url%</a><br>
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: 900
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
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
Files i try to keep and share can be found on my google drive: