rejetto forum

Feature request: Transfer references to FTP server

CBB · 9 · 5116

0 Members and 1 Guest are viewing this topic.

Offline CBB

  • Occasional poster
  • *
    • Posts: 21
    • View Profile
It would be very usefull to give references on files not only in http://server/folder/file.ext form, but also in ftp://server/folder/file.ext form or only in one of them on the admin choice. This would make from HFS the excelent http shell for any FTP server. Note that FTP servers use much less resources for files transactions, especially on fast channels.
By the way - may be it is possible to realize this in template, without changing the main code?
« Last Edit: March 09, 2008, 04:18:12 PM by CBB »


Offline Giant Eagle

  • Tireless poster
  • ****
    • Posts: 535
  • >=3 RAWR!
    • View Profile
    • RAWR-Designs.com
You can already do that

Simply modify the <a href=""> tag inside the template so that it uses the ftp:// protocol

ftp://%encoded-folder%%item-name%


Offline CBB

  • Occasional poster
  • *
    • Posts: 21
    • View Profile
Thanks a lot, you've answered while I was editing the post to propose something similar :)
I'll try.


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2068
    • View Profile
You can use hfs as Web server and put it urls links steered towards your files on a server ftp of your choice. It is not the most elegant way but she works



Offline CBB

  • Occasional poster
  • *
    • Posts: 21
    • View Profile
Sorry, but I look at templates and can't understand what exactly should I change. Could you be more specific? What strings and how in standart or RAWR templates should I edit?
« Last Edit: March 09, 2008, 05:16:31 PM by CBB »


Offline CBB

  • Occasional poster
  • *
    • Posts: 21
    • View Profile
Yes! It works! In standard template I've changed

[item start]
  <tr><td>
  {.if|{.get|is new.}|<span class=flag>&nbsp;NEW&nbsp;</span>.}
  {.if not|{.get|can access.}|<img src='/~img_lock'>.}
  <a href="%item-url%"><img src="%item-icon%" /> %item-name%</a>
  {.if| {.?search.} |{:<div class=item-folder>{.!item folder.} <a href="%item-folder%">%item-folder%</div>:} .}
  {.if| %item-comment% | <div class=comment>%item-comment%</div> .}


to

[item start]
  <tr><td>
  {.if|{.get|is new.}|<span class=flag>&nbsp;NEW&nbsp;</span>.}
  {.if not|{.get|can access.}|<img src='/~img_lock'>.}
  <a href="ftp://%host%%encoded-folder%%item-name%"><img src="%item-icon%" /> %item-name%</a>
  {.if| {.?search.} |{:<div class=item-folder>{.!item folder.} <a href="%item-folder%">%item-folder%</div>:} .}
  {.if| %item-comment% | <div class=comment>%item-comment%</div> .}

Thanks a lot again
« Last Edit: March 09, 2008, 05:42:47 PM by CBB »


Offline Turrenell

  • Occasional poster
  • *
    • Posts: 12
    • View Profile
Yes! It works! In standard template I've changed

[item start]
  <tr><td>
  {.if|{.get|is new.}|<span class=flag>&nbsp;NEW&nbsp;</span>.}
  {.if not|{.get|can access.}|<img src='/~img_lock'>.}
  <a href="%item-url%"><img src="%item-icon%" /> %item-name%</a>
  {.if| {.?search.} |{:<div class=item-folder>{.!item folder.} <a href="%item-folder%">%item-folder%</div>:} .}
  {.if| %item-comment% | <div class=comment>%item-comment%</div> .}


to

[item start]
  <tr><td>
  {.if|{.get|is new.}|<span class=flag>&nbsp;NEW&nbsp;</span>.}
  {.if not|{.get|can access.}|<img src='/~img_lock'>.}
  <a href="ftp://%host%%encoded-folder%%item-name%"><img src="%item-icon%" /> %item-name%</a>
  {.if| {.?search.} |{:<div class=item-folder>{.!item folder.} <a href="%item-folder%">%item-folder%</div>:} .}
  {.if| %item-comment% | <div class=comment>%item-comment%</div> .}

Thanks a lot again

Hi! You can use a bit trick in this funtion, I use "ftp://user:password@ftp.host.xxx:port".

For example: 

  {.if not|{.get|can access.}|<img src='/~img_lock'>.}
  <a href="ftp://user:password@%host%:PORT%encoded-folder%%item-name%"><img src="%item-icon%" /> %item-name%</a>

If you replace with VARS that you can create:

%FTPUSER% for user if not the same in ftp server account.
%FTPPASS% for pass if not the same in ftp server account.
%FTPPORT% for port if isn's default ftp server port " TCP 21".
In this point you must separete port "xxxx:21/%encoded-folder%", if "%encoded-folder%" don't introduce in URL.

Try it and tell us, please.

Regards.

____________________________________________
SPANISH:

Podemos usar un pequeño truco para contruir la URL: "ftp://user:password@ftp.host.xxx:port".

La intención es generar unas variables específicar para cada elemento de la auteticación en el servidor FTP.

Una variable para el usuario, otra para la contraseña y otra para el puerto, si este es distinto del puerto por defecto. " TCP 21 ".
____________________________________________


Offline CBB

  • Occasional poster
  • *
    • Posts: 21
    • View Profile
My previous code is wrong, the right way is to replace

[file]
{.$item start.}<td align=right>%item-size%<td align=right>%item-modified%<td align=right>%item-dl-count%
 
with
 
[item startf] 
  <tr><td> 
  {.if|{.get|is new.}|<span class=flag>&nbsp;NEW&nbsp;</span>.} 
  {.if not|{.get|can access.}|<img src='/~img_lock'>.} 
  <a href="ftp://%host%%encoded-folder%%item-name%"><img src="%item-icon%" /> %item-name%</a> 
  {.if| {.?search.} |{:<div class=item-folder>{.!item folder.} <a href="%item-folder%">%item-folder%</div>:} .} 
  {.if| %item-comment% | <div class=comment>%item-comment%</div> .} 
 
[file]
{.$item startf.}<td align=right>%item-size%<td align=right>%item-modified%<td align=right>%item-dl-count%
 

this works fine in pair with Filezilla server, though users must login to ftp server when downloading files.


user:password works, but only for login=user and pass=password. Http login and password are not transfered with this string.


Offline Turrenell

  • Occasional poster
  • *
    • Posts: 12
    • View Profile
My previous code is wrong, the right way is to replace

[file]
{.$item start.}<td align=right>%item-size%<td align=right>%item-modified%<td align=right>%item-dl-count%
 
with
 
[item startf] 
  <tr><td> 
  {.if|{.get|is new.}|<span class=flag>&nbsp;NEW&nbsp;</span>.} 
  {.if not|{.get|can access.}|<img src='/~img_lock'>.} 
  <a href="ftp://%host%%encoded-folder%%item-name%"><img src="%item-icon%" /> %item-name%</a> 
  {.if| {.?search.} |{:<div class=item-folder>{.!item folder.} <a href="%item-folder%">%item-folder%</div>:} .} 
  {.if| %item-comment% | <div class=comment>%item-comment%</div> .} 
 
[file]
{.$item startf.}<td align=right>%item-size%<td align=right>%item-modified%<td align=right>%item-dl-count%
 

this works fine in pair with Filezilla server, though users must login to ftp server when downloading files.


user:password works, but only for login=user and pass=password. Http login and password are not transfered with this string.

Ok. But, if you use my funtion, the ftp server don't answer the user name or pass.
The strings is reevaluated from the HFS LOGON captured to new variables.
I try write a real code example for to show you.
This solution will make transparent login in ftp server.

See you, bye.