rejetto forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - LeoNeeson

Pages: 1 2
1
Bug reports / Bug: Logout function at server level [Fixed]
« on: April 25, 2020, 10:46:27 PM »
SOLVED!

» Edit #3 (12-05-2020): Now logout is 100% perfect on v2.4 Alpha 8.

» Edit #2 (09-05-2020): This was almost fixed by Rejetto on v2.4 Alpha 5.

» Edit #1 (07-05-2020): I had to edit the title (Confirmed bug: HFS doesn't discard previous auth sessions), because it seems some people have not understood it. Like the title says: HFS doesn't discard the 'session ID' of a authenticated user, when he logouts using a form-based login (we are talking about the 'logout' function at server level, and to reproduce the bug, the user must not use the native login function of the browser).



@Message to Rejetto, Mars, SilentPliz or any other Delphi/Pascal programmer:

• Steps to reproduce this possible bug:
1) Use default 2.3's template along with this form-based login (diff-template).
2) Create a user and have some shared folders protected with a password.
3) Open your browser and use the form-based login to authenticate (do NOT enter credentials on the browser's internal popup login, hit cancel on that popup window).
4) Open several password-protected folders, in several browser tabs, and navigate thought those sub-folders if you want.
5) Click on the 'Logout' button, change to another tab, and navigate on some password-protected resource (you will be automatically logged in again!).

» Why this is a HFS bug and not a fault in the template?...
Please follow the next steps and you will find how it SHOULD work: :)
A) Follow steps 1 to 5, but after clicking on the logout, temporary close HFS.
B) Open HFS again, and now try to navigate on some password-protected resource (you will NOT be automatically logged in!). Yay! :D This demonstrates that HFS is not discarding (in his memory) the association between some previously logged in USER and the session ID (SID) he used.

- You may say: but this could be solved on the client side by generating a new 'session ID' cookie. You are right, but if the user had several tabs open (or if he goes back in the browser history), he will be automatically logged in back again, and this is unwanted (and insecure).

- What this means?: This means that when this bug is fixed, no matter if you go back in your browser, once you logout you can't access any password protected resource anymore (no matter if you had multiple tabs open).

If you have any questions or difficulties on reproducing this, please ask me. This thread is open to anyone, so, don't be afraid to leave your question... ;)

Cheers,
Leo.-

2
HTML & templates / [Help] Making old template run entirely on Ajax
« on: April 16, 2020, 05:22:36 PM »
Hi people! :) I'm experimenting on making the old legacy template work entirely using Ajax/XHR requests, to avoid reload/refreshing/loading a new page. Here is my current work (download the old template here, or use the default template of HFS v2.3m, and replace the 'body' with the following code):

Quote
<body>
<!--{.comment|--><h1 style='margin-bottom:100em'>WARNING: this template is only to be used with HFS 2.3 (and macros enabled)</h1> <!--.} -->
{.$box panel.}
<div id="list-panel"></div>

<script type="text/javascript">
  var xhr = new XMLHttpRequest();
  xhr.open("GET", "/~list");
  xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  xhr.onload = function() {document.getElementById("list-panel").innerHTML = xhr.responseText};
  xhr.onreadystatechange = function() {
    if (xhr.readyState == 4 && xhr.status == 200) {
      alert("XHR request OK");
    }
    if (xhr.readyState == 4 && xhr.status == 401) {
      alert("XHR request fail");
    }
  }
  xhr.send();
</script>


</body>

And here is a shorter version:

Quote
<body>
<!--{.comment|--><h1 style='margin-bottom:100em'>WARNING: this template is only to be used with HFS 2.3 (and macros enabled)</h1> <!--.} -->
{.$box panel.}
<div id="list-panel"></div>

<script type="text/javascript">
  var xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      document.getElementById("list-panel").innerHTML = this.responseText;
      alert("XHR request OK");
    }
  };
  xhr.open("GET", "/~list", true);
  xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xhr.send();
</script>


</body>

The XHR request work (I'm temporally using an 'alert' to be sure), but the files are not show. I'm sure my code is wrong. The %list% variable fails (doesn't get executed, since, if I'm not mistaken, %list% is meant to run on the server side, but the XHR is run on the client side). I don't know what to change to make this work, but I'm open to listen your suggestions...

This was requested and discussed a long time ago (here), and there Rejetto suggested a way more elegant (shorter) Ajax code. So, feel free to suggest a more pure Ajax-jQuery code, as long it work on old browsers (to support the same old browsers that this old template supported). Please avoid using ES6 (like 'promises', or anything not supported by legacy browsers). My objective is to use JavaScript code compatible with jQuery v1.4.2 (or the most "pure" plain vanilla JavaScript as possible).

I don't want to redesign the old template, only to make it entirely run on Ajax, so the changes must be as minimal as possible. Anyone feel free to collaborate, this post is open to everyone. ;)

Cheers,
Leo.-

3
Everything else / Something about me...
« on: October 05, 2019, 09:06:33 PM »
Hi everyone! :) I was afraid to login and find thousands of unread topics and emails (but I had to do it one day or another). I've received personal messages from some of you, and I really thank you for thinking on me, and worrying about my life (I truly appreciate it).

About my physical (medical) life "I'm fine", but with "very high financial problems" (and it's going worst every day). In the last 6 to 9 months my economic life changed almost 180 degrees, and that left me with very little free time (too much work, too much stress and way less money than before). Anyway, don't worry, there is nothing you can do to help me, and I'll try to somehow overcome this situation.

My enthusiasm about HFS (and helping people on the forum) is intact, but sadly, for the time being is impossible for me (given my lack of spare time) to actively participate on the forum. @SilentPliz: I will continue working on what I promised to do, but without a 'delivery' date.

I hope you are all well, and I encourage all of you to keep going.

Cheers,
Leo.-

4
Español / [Tutorial] Cómo compilar el código fuente de HFS
« on: November 21, 2018, 09:00:23 AM »
[Tutorial] Cómo compilar el código fuente de HFS

Por primera vez en la historia de este foro, me gustaría compartir con ustedes el proceso de compilar el código fuente de HFS, de la manera más simple posible para que cualquiera de ustedes pueda realizarlo sin problemas. Se recomienda previamente ver ESTE video tutorial (en formato GIF animado, de 1,56 MB que también puedes descargar de aquí), para poder previsualizar en apenas 5 minutos todo el proceso completo. Luego puedes seguir las instrucciones que dejo a continuación.

Simplemente sigan estos pasos:

1] Descarga el 'Portable Turbo Delphi Lite v1.0d', de aquí.
2] Descarga el 'Paquete de componentes' requeridos HFS, de aquí.
3] Descarga el 'Código fuente' de la última versión de HFS, de aquí.
4] Instala y/o descomprime el ejecutable del paso uno, en: C:\Portable\TDLite
5] Descomprime el archivo del paso dos, en esta carpeta: C:\Portable\TDLite\lib
6] Descomprime el código fuente de HFS, del paso tres, aqui: C:\Portable\TDLite\Projects\HFS
7] Inicia Turbo Delphi abriendo "TDrun.exe" o utilizando el acceso directo del escritorio.
8] Ve al menú 'Tools' y haz click en 'Options...' y se abrirá una nueva ventana.
     Allí, ve a: 'Environment Options' > 'Delphi Options' > 'Library - Win32'.
     Ahora en 'Directories' > 'Library path:' reemplázalo con la siguiente ruta:

Code: [Select]
$(BDS)\lib;$(BDS)\lib\Obj;$(BDS)\Imports;$(BDS)\lib\DelphiZLib.128;$(BDS)\lib\FastMM4991;$(BDS)\lib\GifImaged2010b;$(BDS)\lib\JCL1_22\source;$(BDS)\lib\Kdl32;$(BDS)\lib\OverbyteIcsV7Gold\Delphi\Vc32;$(BDS)\lib\TRegExpr\Source;$(BDS)\Projects\HFS;
9] Ahora ve al menu 'File' y haz click en 'Open Project...' y abre el archivo 'hfs.bdsproj'.
10] Luego ve al menu 'Project' y haz click en 'Options...' y se abrirá una nueva ventana.
       Allí, haz click en 'Compiler Messages' y luego en 'Warnings', desmarca o deselecciona los siguientes items:

Code: [Select]
    - Deprecated Symbol
    - Platform Symbol
    - Return value of function might be undefined

(Este paso número 10 es enteramente opcional, pero se recomienda hacerlo. Si no lo haces, encontrarás 32 o 33 advertencias ó 'Warnings' de Delphi, al momento de compilar, pero ésto no afecta en absoluto el proceso de compilación y obtendrás el mismo y funcional ejecutable. Éstas advertencias no son importantes, sino informativas).

11] Finalmente, ve al menu 'Project' y haz click en 'Build hfs' y todo se compilará.
       Una vez compilado, verás (en un texto en negrita): 'Done: Build All', haz click en 'OK' y habrás concluído.
       Encontrarás tu nuevo ejecutable hfs.exe en ésta carpeta: C:\Portable\TDLite\Projects\HFS

12] Que lo disfrutes! :)

Si necesitas un programa para descomprimir, puedes utilizar 7-Zip.

Si necesitas o deseas instalar todo en otra carpeta (para tener todo en un pendrive USB), es mejor que completes los pasos uno al seis desde las ubicaciones indicadas, y que luego antes de efectuar el paso siete, muevas toda la carpeta al dispositivo USB que quieras. De ésta manera, te aseguras de no equivocarte con las ubicaciones de carpeta. Desde luego, si eliges otra carpeta deberás cambiarla en todos los pasos, EXCEPTO que no debes modificar la ruta del paso ocho (ya que el programa auto-detectará la nueva ubicación).

» RENUNCIA DE RESPONSABILIDAD: No me hago responsable de ningún daño o desconfiguración de su PC. Siempre haga una copia de seguridad primero y tenga en cuenta que este tutorial se realizó en una computadora con un Windows recién instalado. Si ya tiene instalada alguna versión de Delphi, tenga en cuenta que ejecutar esta versión portátil de 'Turbo Delphi' podría ocasionarle problemas (así que evite usarla en una PC con Delphi instalada). Mis archivos subidos no fueron modificados por mí, y están libres de virus, pero debe comprobar las sumas de verificación MD5 para asegurarse que los archivos que ha bajado sean los mismos:

Quote
hfs2.3m.src.zip / MD5: AE2C3025B36FFF2BC72DB5FF7784C4BD
HFS.Libraries.zip / MD5: 7751002A930B7C211BFC1F9C7AA1853C
PortableTurboDelphiLiteInstaller10d.exe / MD5: 9B24FA6BD91FAF9ACA8AEA78B90AEF07
(Puedes utilizar el freeware HashCheck para verificar las sumas de comprobación MD5 de los archivos que has descargado)

» HFS.Libraries.zip / Enlaces de descarga:
https://www.4shared.com/s/fsY2jRS7Tda
http://www.mediafire.com/?z32tkfzezfx36i7

Siéntete libre de dejar cualquier comentario o pregunta si tienes alguna duda, y por favor reporta cualquier error o problema que encuentres al momento de compilar. Se aprecia todo tipo de comentarios, críticas constructivas, o sugerencias de cualquier tipo (tu comentario me da más ánimo para seguir publicando nuevos tutoriales).

Saludos,
Leo.-

5
Programmers corner / [Tutorial] How to compile the HFS's Source code
« on: November 21, 2018, 07:04:05 AM »
[Tutorial] How to compile the HFS's Source code

As the result of this, and for the first time ever, I would like to publish the complete process of compiling the HFS's Source code (as simple as possible, step by step, so everyone could do it). It's recomended to watch first THIS video tutorial (download size: 1.56 MB, in GIF format), to see the enterelly compilation process. Then, just follow these steps:

1] Download 'Portable Turbo Delphi Lite v1.0d', from here.
2] Download the 'Library pack' required by HFS, from here.
3] Download the latest 'Source code' file of HFS, from here.
4] Install and/or unrar the exe of the step one, on: C:\Portable\TDLite
5] Unzip the file from the step two, on this exact folder: C:\Portable\TDLite\lib
6] Unzip the source code file of HFS, from step three, here: C:\Portable\TDLite\Projects\HFS
7] Start Turbo Delphi by opening the file "TDrun.exe" or using the shortcut on your desktop.
8] Go to the menu 'Tools' and click on 'Options...' and the 'Options' window will open.
     There, on go to: 'Environment Options' > 'Delphi Options' > 'Library - Win32'.
     Now on 'Directories' > 'Library path:' replace it with the following path:

Code: [Select]
$(BDS)\lib;$(BDS)\lib\Obj;$(BDS)\Imports;$(BDS)\lib\DelphiZLib.128;$(BDS)\lib\FastMM4991;$(BDS)\lib\GifImaged2010b;$(BDS)\lib\JCL1_22\source;$(BDS)\lib\Kdl32;$(BDS)\lib\OverbyteIcsV7Gold\Delphi\Vc32;$(BDS)\lib\TRegExpr\Source;$(BDS)\Projects\HFS;
9] Go to the menu 'File' and click on 'Open Project...' and locate the file 'hfs.bdsproj'.
10] Go to the menu 'Project' and click on 'Options...' and the 'Project Options' will open.
       There, click on 'Compiler Messages' and on 'Warnings', uncheck the following items:

Code: [Select]
    - Deprecated Symbol
    - Platform Symbol
    - Return value of function might be undefined

(This entirely step 10 is optional, but recommended. If you don't do it, you will encounter 32 or 33 Warnings on compiling time, but this doesn't affect the compilation process and you will get the very same functional executable. Those warnings are not important, but informative).

11] Finally, go to the menu 'Project' and click on 'Build hfs' and wait the process to finish.
       Once finished, you will see (in bold text): 'Done: Build All', click on 'OK' and it's done.
       You will find the new executable hfs.exe on this folder: C:\Portable\TDLite\Projects\HFS

12] Enjoy! :)

If you need a tool to unzip/uncompress, you can use 7-Zip.

If you want to use another folder path location (for example to run it from a USB drive), it's better you complete steps one to six from those locations, and then move that folder to the USB before running step seven. This way, you don't mess up with folder locations. Of course, if you choose another folder, you need to change the path in all the steps, but do NOT change the path of step eight (since it will auto-detect the new location).

» DISCLAIMER: I'm not making me responsible for any damage or miss-configuration on your PC. Always backup first, and keep in mind this tutorial was done on fresh installed Windows computer. If you already have any version of Delphi, running this portable version of 'Turbo Delphi' could lead you to problems, so avoid using it on a PC with Delphi installed. My uploads are untouched and virus free, but you must re-check that the MD5 file checksums are the same, as follows:

Quote
hfs2.3m.src.zip / MD5: AE2C3025B36FFF2BC72DB5FF7784C4BD
HFS.Libraries.zip / MD5: 7751002A930B7C211BFC1F9C7AA1853C
PortableTurboDelphiLiteInstaller10d.exe / MD5: 9B24FA6BD91FAF9ACA8AEA78B90AEF07
(You could use the freeware HashCheck to verify the MD5 file checksums)

» HFS.Libraries.zip Download link:
https://www.4shared.com/s/fsY2jRS7Tda
http://www.mediafire.com/?z32tkfzezfx36i7

Feel free to leave a comment or ask any question if you have doubts, and also report if you find any problem when compiling, or if you need further help.

Cheers,
Leo.-

6
Programmers corner / [Solved] Friendly petition to Mars or any programmer
« on: November 14, 2018, 09:45:44 PM »
Since a long time I wanted to build HFS by my self, and recently I've found this 'Portable Turbo Delphi Lite v1.0d' here. But that's not enough, since I need all the library components listed on 'developer notes.txt' (but I've read here in various posts on the forum, that the configuration and installation of those components is not very straightforward and it's prone to give errors on compiling time).

I rarely ask for help, but this time I'm asking to someone who already had compiled HFS, the following...

@Mars/Anyone: Could you please provide me the ./lib folder (with all the components included, and with everything ready to compile HFS, including the configuration file 'TDrun.reg' of your 'portable Turbo Delphi' folder?...

@Mars: Over the years, you have many times proposed excellent code changes and enhancements that some of them were later discarded or not used by Rejetto. That's why I would love to have your own custom modified HFS source code, since it could contain many of those interesting changes that were not included on the final version of HFS. So, Mars: would you be kind enough to share with me your the source code of HFS with the custom modifications done by you?. This is a very small file (that you could even attach in this thread), or send me a download link in a private message, if you don't want to keep it public. If you don't like to share it with me, it's OK, I will accept your answer, but please don't give me an ironic 'wait, wait and wait' response.

Cheers, :)
Leo.-

7
HTML & templates / Old default template for new and legacy browsers
« on: November 05, 2018, 07:00:25 AM »
Since Rejetto has updated the default template of HFS v2.4 to a new responsive mobile-friendly version (and also have updated jQuery from v1.4.2 to v1.12.4), I decided it's time to release a specially modified version of the old default template you found on past HFS versions, up to v2.3m, supporting both new and legacy browsers. The only modification I did is embedding the old jQuery v1.4.2, and the rest of the code is untouched. This file was taken from the source code of v2.3m (default.tpl).

You can use this old default template (that's attached to this post) on HFS v2.4 and newer versions too, but keep in mind that Rejetto only gives support to browsers not older than JAN/2006 with some exceptions (as he stated here), so keep in mind that the use of this template is officially unsupported (and unless Rejetto says otherwise, I'm currently the only one who gives support for it, but rest assured this template is rock-solid stable).

In the case you use an old custom template (that makes use of old jQuery) on a legacy browser (older than 2016), you will need to make the following modification, simply replacing this text (marked in red):

Quote
<script type="text/javascript" src="/?mode=jquery">

...to the following text (marked on green color):

Quote
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">



Or if you want to make it work offline (because you use HFS on a LAN, without internet access), the modification is more complex (and is exactly the same modification I did on the attached template), and you need to use this:

Quote
<script type="text/javascript" src="/?mode=section&id=jquery.js">

And also add the following text, before this section: [file=folder=link|private]

Quote
[jquery.js|no log|cache]
/* Copy and paste here the contents of the jQuery v1.4.2 file */



If you have any doubts, use as reference the template attached to this post, or feel free to ask me for help, by leaving a message here, in this post (the support I'm giving is limited only to make work the old jQuery v1.4.2 with your template, and nothing else). If your template doesn't use jQuery at all, you don't need to make any modification. An alternative to this template, is using 'The really fast Throwback (retro) template' made by danny.

Enjoy! :) ...and don't forget to leave a comment if you find this useful!
(and thanks to Rejetto for making it the default template for almost 8 years)

Code: [Select]
File: legacy-template.tpl
MD5: 048E8A2A4A4F6AA8D6B544A24CECE11F

Cheers,
Leo.-

8
EDIT: As reference, I comment this thread was started here and then moved here. The idea started after reading the code of mobil-light_V4.2beta.zip by dj (thanks him for the inspiration, Mars for the actual code implementation that you will find below, and Rejetto, because he took this idea into consideration). Now it follows the original post...



Offtopic: Reading your template, I always wondered is a file section (in the HFS template), could store a file encoded in Base64, and that be decoded by the server on-the-fly (delivering the decoded output).

I see you have write this:

Code: [Select]
[mystyle.css]
{.mime|text/css.}
a {text-decoration: none}

...and I expected this to deliver the same output (but it doesn't):

Code: [Select]
[mystyle.css]
{.mime|text/css;base64.}
YSB7dGV4dC1kZWNvcmF0aW9uOiBub25lfQ==

I already know that is possible to directly write Base64 code, like this:

Code: [Select]
<link rel="stylesheet" type="text/css" href="data:text/css;base64,YSB7dGV4dC1kZWNvcmF0aW9uOiBub25lfQ==" />
But I was wondering if is it possible make HFS decode Base64 'on-the-fly' using a macro like: {.mime|text/css;base64.}

Also, neither of the following works:

Code: [Select]
[mystyle.css]
{.base64|YSB7dGV4dC1kZWNvcmF0aW9uOiBub25lfQ==.}

Code: [Select]
[mystyle.css]
{.base64decode|YSB7dGV4dC1kZWNvcmF0aW9uOiBub25lfQ==.}

I'm curious to know if this is possible using macros. ???

9
Programmers corner / Adding Two-Factor Authentication (2FA) to HFS
« on: September 23, 2018, 01:16:24 AM »
Since HFS currently depends only on a primitive and weak HTTP/1.1 login system (where unless you use SSL, the password travels in clear text, encoded in Base64), I was thinking it would be nice if HFS implements a simple Two-Factor Authentication system (also known as TOTP or 2FA). This system is a time-based password algorithm (which change every 30 seconds), added on top of the current login. This way, if someone steals the user/pass, they could not get through the TOTP/2FA system (since the 2FA would prevent the access to your private account and files, even if they know the password).

- How this works on the server?
The server needs to generate a secret key (only once, when setting up the 2FA), and it would store that secret key (encoded in Base32) along with the user/pass (I'm always talking about the server part). At user/client level, when TOTP is enabled on HFS, it should check if the credentials (user/pass) are correct first, and then if they are valid it should ask for the 2-Factor Authentication Code. To make this work (like I've said), HFS should store (along with the username and password) the 2FA 'secret key' needed to generate the 2FA time-based codes. The rest of the work flow (at server level) can be read here. To end-users, I guess most of you know how the Two-Factor Authentication works, since Gmail already use it since several years (check out this, if have any doubts).

- Implementing TOTP on HFS using a free Delphi library
After a deep search, I've found a small Delphi/FreePascal/Lazarus library, that could make easy the implementation on HFS: https://github.com/nikosdion/timecode

And now that version 2.4 is on beta test (and since HFS is doing a step from v2.3 to v2.4), I think is a great time to make the server a little more secure by default. I hope Rejetto like and welcome the idea, and if anyone here could collaborate at code level to make this works on HFS, it would be great :) (this is only a suggestion, not a petition to add it).

Cheers,
Leo.-

10
HTML & templates / Alternative login form for modern browsers
« on: August 25, 2018, 03:05:25 AM »
Thanks to danny and his idea (in this post), and after spending several hours finding a solution and doing lot of tests, I think we finally have a working workaround solution for login from mobile browsers (that it even work on desktop browsers too).

1. In the "Virtual File System" box, right click on the first element (Home)
2. Properties
3. Diff template
4. Enter this text:
Code: [Select]
[unauthorized]
<h1>{.!Unauthorized.} {.!&#47; Please login&hellip;.}</h1>
{.!Either your user name and password do not match, or you are not permitted to access this resource..}<br>
{.!Please login to access to your account, and check if you have the correct permissions to continue..}<br>

<br>
<fieldset id='login'>
  <legend><img src="/~img27"> {.!Login.}</legend>
  <center>
    <input type='text' id='usr' size='15' placeholder=" Username" value=""><br>
    <input type='password' id='psw' size='15' placeholder=" Password" value=""><br>
    <input type='button' id='lognow' style="width:110px;" value="{.!Login.}" onclick="NewLogin();">
  </center>
</fieldset>
<br>

<script>
function NewLogin() {
  var xhr = new XMLHttpRequest();
  var ThisFolder = window.location;
  var ThisUser = document.getElementById("usr").value;
  var ThisPass = document.getElementById("psw").value;
  var LoginToken = ThisUser+':'+ThisPass;
  xhr.open("GET", "/~login", true);
  xhr.withCredentials = true;
  xhr.setRequestHeader("Authorization", 'Basic ' + btoa(LoginToken));
  xhr.onreadystatechange = function() {
    if (xhr.readyState == 4 && xhr.status == 200) {
      if (window.location.href.indexOf("~login") != -1) {
        window.location.replace('/?success');
        } else {
          window.location.replace(ThisFolder);
      };
    }
    if (xhr.readyState == 4 && xhr.status == 401) {
      alert("Invalid credentials! \(Wrong username or password\)");
    }
  }
  xhr.send();
}
</script>

Please test it and report the results (remember to create an account first on HFS). I've literally wasted all my free afternoon, but I'm happy with the results!. It may not be perfect, so, feel free to adapt/correct/enhance the code... ;)

Cheers,
Leo.-

11
HTML & templates / Simple contact template
« on: July 22, 2018, 09:26:42 AM »
Today I was trying to get working a simple contact template, that automatically save its contents as a local .txt file. To apply this template, follow these steps:

1. Create a folder named, for example as: contact (add it as real folder)

2. Extract from the zip the "hfs.diff.tpl" of the version you've choosen.

3. Copy that file (hfs.diff.tpl) to the "contact" (or whatever name you choose) folder you made on the first step.



» Versions:

Macro-Method = Using Form + Macros (without needing upload permissions)
XML-Method = Using XMLHttpRequest (needs upload permissions to anyone)
EML-Email = Same as XML-Method, but it saves in .eml format instead of .txt

» Description:

Both version are currently functional, but still need to add some kind of field validation (to check if the fields are empty or not), and perhaps we can also show that the message was successfully sent using another methods than showing a simple 'alert' (getting some answer back from the server, at least in the v1.0b-XML-Method). The v1.0a-Macro-Method could have redirect to page like (after the form was submitted):

Code: [Select]
[success]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Message successfully sent</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head><body><h3 style="color:black;">The message was successfully sent!</h3>
</body></html>

Thanks to dj for his help! :) (without him, this couldn't be done)
Any other enhancements/suggestions are welcome!

Cheers,
Leo.-

12
» Update: February 10, 2020
Latest version/revision: HERE.

» Change log:
May 27, 2018 > Fixed a serious security hole found on this script (by Mars)
August 02, 2019 > Using %encoded-folder% as the destination (by danny).

» To-do list:
- Progress bar (when uploading)
- Show a link (to the uploaded file)



» ATTENTION: The text below, is left as-is (only as a reference), so, it's not recommended for public use, because in those previous/initials stages of this script, a serious security hole was found (that allowed access to any file on the entire hard disk hosting HFS), which was solved HERE (thanks to Mars). There is no need to panic, but if you use an old version, just be sure to restrict the access of this script only to yourself. It is recommended to always use the latest version.



Hi there! I was reading these wiki pages (Template macros & scripting commands), trying to being able to download and save an external file to the current folder (Remote upload), but I can't get it working.

Please check my code (in my example, there is an URL already loaded, of a Tiny Core Linux ISO file). The following code works fine, but it's NOT recommended as it could overload the RAM if you are downloading a big file (I only leave this as reference):

THIS CODE WORKS:
Code: [Select]
<form method='post'>
URL: <input name='url' value="http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso">
<br>Filename: <input name='dest' value="%folder%Core-9.0-GOOD.iso">
<br><input type='submit'>
</form>
{.set|url|{.postvar|url.}.}
{.break|if={.not|{.^url.}.}.}
{.set|dest| {.or|{.filename|{.postvar|dest.}.}|{.filename|{.^url.}.}|downloaded.} .}

{.load|{.^url.}|var=data.}
{.and
| {.length|{.save| ./{.^dest.} |var=data.}.}
| Downloaded {.^dest.} for {.length|var=data.} bytes
.}

The following is the recommended code by rejetto here (chinking the file every 1MB), but it doesn't work as expected (the download has a never ending loop). This code not only doesn't work, but besides that, it also have missing the text "Downloaded Core-9.0.iso for 13256704 bytes" and the event doesn't get logged on HFS's log.

THIS CODE DOESN'T WORK: (why?)
Quote
<form method='post'>
URL: <input name='url' value="http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso">
<br>Filename: <input name='dest' value="%folder%Core-9.0-BAD.iso">
<br><input type='submit'>
</form>
{.set|url|{.postvar|url.}.}
{.break|if={.not|{.^url.}.}.}
{.set|dest| {.or|{.filename|{.postvar|dest.}.}|{.filename|{.^url.}.}|downloaded.} .}

{.set|from|0.}
{.set|chunk|1000000.}
{.save|{.^dest.}|.}
{.while|chunk|{:
   {.load|{.^url.}|var=data|size={.^chunk.}|from={.^from.}.}
   {.if|{.length|var=data.}
      | {:{.append|{.^dest.}|var=data.}
         {.inc|from|{.length|var=data.}.}
        :}
      | {:{.set|chunk|0.}:}.}
:}|timeout=0.}

Could someone point me where is the fault?... :-\

13
Español / HFS en Español - Versiones beta
« on: December 05, 2017, 12:22:43 PM »
HFS en Español v2.3k #299 Beta [05-DIC-2017]

» Descarga:
https://www.4shared.com/s/f1CqBvhssei
http://www.mediafire.com/?2vv2yc76tv1dkpa

Code: [Select]
Nombre: HFS v2.3k Build #299 Spanish Beta [05-DIC-2017].rar
CRC-32: 0CA7F67A
   MD4: 6B7E71011E61419D304435B3F60EB01C
   MD5: D19336717A380BD874E592B1BA8EF411
 SHA-1: B775B108B31BB7FDFCB832D75B7F4022D555862F

Versión portable: Descomprima el archivo RAR en una carpeta nueva y listo.
Solo actualización: Para aquellos que hayan bajado exactamente ESTA versión preview y deseen actualizar a esta versión en español, pueden descargar y descomprimir ESTE archivo adjunto en la carpeta donde tienen instalado HFS, conservando asi toda su configuración actual (haz siempre una copia de seguridad antes de sobrescribir cualquier archivo).

» Basado en la 'compilación previa' de la próxima versión 2.3l (Build #300).

Que lo disfruten! :)
Leo.-
 

14
FHFS / FHFS: Is there going to be any update on this?
« on: August 29, 2016, 04:24:09 AM »
@Raybob: Is there going to be any update on this? Since in the HFS.ini of FHFS v2.1.3, the updates of the internal HFS (server.dll) are not automatic (update-automatically=no), it would be great to have an updated version with the last HFS v2.3i Build #297 running out-of-the-box. There are many users out there who are still using FHFS with a built-in outdated HFS v2.3d Build #292. And since there was a VERY important security update in this last version, many users may be exposed to hackers, like recently happened here. I understand that having the automatic updates disabled is to ensure everything keeps working/compatible with the rest of the FHFS code. I also understand that you may not want (or have the time) to be updating FHFS every time a new version of HFS is out, but this time is critical to have an update (since it fixed a "Remote Command Execution" exploit).

15
HFS ~ HTTP File Server / Changing HTTP response header
« on: May 22, 2016, 09:36:06 AM »
OK, I've started a new thread to keep this organized. This post started here, and the question was: How to change the HTTP response header "Server" (or any other string in the header) using Macros? ("Server" is a string that displays the name of the server, and it shows the HFS version). If you don't know what I'm talking about, use a Download Manager that show this info (for example, I'm using FlashGet).

Suggestions and examples are welcome. :)

Pages: 1 2