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.

Messages - LeoNeeson

Pages: [1] 2 3 ... 29
HTML & templates / Re: Need help with file delete feature.
« on: June 01, 2018, 10:22:36 PM »
Back when the web was new, sites had a sharp clarity look. The blue&silver colors probably help too. The 90's style of HTML forces more attention to detail, like using a little paint brush instead of a big paint brush.
+1 for using <marquee><b>HFS</b></marquee>, that gives the nostalgic touch. :)

The problem:
Slowdowns are caused by a feature inside file list loop (load*files*users).
Macros and server side scripts are disaster when magnified times the number of files.

Currently, the delete feature costs 28% of the speed when done like this:
   {.if|{.get|can delete.}|<td class=rw align=center><form method='post' id='filelist'><input type='hidden' name='selection' value='%item-url%'><button type='submit' name='action' value='delete' class='del' onclick='return confirm("Delete %item-name%?")'>X</button></form></td>.}
if 40 users browsing 1000 files, the code gets 40,000 times bigger, and you get a broken server
Sometime ago, I was thinking in another approach: removing the delete button, and adding a "+" button instead, which when clicked, it opens a modal screen (in dark grey color) with three nice and big buttons, giving options like: Rename, Delete and Move (and we could even add a 'Send to' when using a mobile). This way, the 'server side' check (to verify if we could delete the file), is only processed on-demand when that "+" button is clicked. I think this could be a win-win situation to solve this, not only because we don't overload the server, but we also add more options. The hard part is coding it... :-[

HFS ~ HTTP File Server / Re: HFS Network Storage Integration
« on: June 01, 2018, 10:22:10 PM »
@Funtime60: I don't know how you add those drives on HFS, but I think you should try adding those network drives not using 'drag-and-drop'. Do this way: right click on the 'House' of 'Virtual File System', and click on 'Add folder from disk...' then click on 'Real folder'. To do this, the network drive should be already listed on 'My PC' first. If it's not listed there, follow the next steps to mount the network drive, reading a guide HERE.

If it's not working, please attach a screenshot of your HFS.

there is a serious security hole in the use of this script, this one in the state allows access to the entire hard disk hosting HFS
Thanks for reporting the security issue. I've updated the first post to warn users about this.

I am studying the case taking into account the eventuality where the source file would be also the file of destination and would be destroyed irremediably during the transfer and its size becomes zero
Do you mean: if the same destination file exist, then delete the destination file? I think it's better to automatically rename the destination file, not to delete/overwrite it. So, if destination file ("filename.zzz") exists, then save new file destination as "filename_001.zzz". If "filename_001.zzz" exists, then save as "filename_002.zzz", or "filename_003.zzz", "filename_004.zzz", and so on...

More info would be needed, like HFS version you use, operating system, CPU model, and confirm if you are using the default HFS template.

Try disabling for a few minutes any security suite (antivirus), and see if this continues (most antivirus automatically scans any incoming/outgoing files and this could hang your PC).

HFS ~ HTTP File Server / Re: Why a session is limited to 1GB?
« on: May 27, 2018, 10:50:19 PM »
It could be your ISP. It's recommended to always use a Download Manager if you are having issues  (you can see a list of Download Managers here). HFS does NOT limit the amount you could download.

See if this post helps you.

HTML & templates / [Testing] Remote upload (Macro)
« on: May 26, 2018, 10:06:25 PM »
@Mars: After doing several tests, everything seems to be working OK, but somehow, I've found a small rare bug/issue: if connection gets closed (or dropped) by the remote server (or by bad connection quality) while downloading a chunk, then the result was getting a corrupted file (I've ended up with a corrupted 15,7MB file, instead of being 12,6MB). It only happened once, and then I couldn't recreate the error. I don't know if we can get a workaround or modify the code to avoid bugs like this happen again, but I will leave you the logs of my tests:

GOOD download (normal log):
10:25:05 Requested GET /
10:25:13 loading from '' 13256704 bytes
10:25:34 chunk=10000000 from=0 size=10000000
10:26:08 chunk=3256704 from=10000000 size=3256704
10:26:09 saved file contain 13256704 bytes
10:26:09 Requested POST /

BAD download (issue log):
(Marked in bold = are the abnormal execution of code)
(Marked in red = comments added by me to describe the situation)
10:36:05 Requested GET /
10:36:17 loading from '' 13256704 bytes
10:36:53 chunk=10000000 from=0 size=10000000 > Connection dropped!
10:37:16 loading from '' 13256704 bytes
10:37:38 chunk=10000000 from=0 size=10000000
10:37:47 chunk=3256704 from=10000000 size=3256704
10:37:48 saved file contain 13256704 bytes
10:37:48 Requested POST /
10:37:48 chunk=3256704 from=10000000 size=3256704 > WTF!?
10:37:49 saved file contain 13256704 bytes > Not true, file was bigger, (exactly 16513408 bytes)!
10:37:49 Requested POST /

Code used (RemoteUpload3.tpl):
<form method='post'>
URL: <input name='url' value="">
<br>Filename: <input name='dest' value="%folder%Core-9.0.iso">
<br><input type='submit'>
{.add to log| loading from '{.^url.}' {.filesize|{.^url.}.} bytes .}
{.break|if={.not|{.filesize|{.^url.}.}.}|result=Source file can't be downloaded: server return nul size.}
{.comment| define CHUNK with the min size, if nul then WHILE is never executed.}
   {.add to log| chunk={.^chunk.} from={.^from.} size={.length|var=data.}.}
      |   {:
         {.comment| redefine CHUNK with the min size, if nul then WHILE is stoped.}
      | {:{.set|chunk|0.}:}
   |else={:{.add to log|Error during WHILE.}
{.add to log| saved file contain {.^from.} bytes.}

» Ideas for solutions/enhancements: I don't know if there is a way to 'detect' if a connection was closed (or dropped) while downloading a chunk, but I think a simple verification of file size after finish the download, could be of help. Also, perhaps a 'progress' bar could be of help, meanwhile the file is downloading (if the download on the server takes too long).

I was trying to add a 'progress' bar, like HFS has by default for uploads (useful if the download on the server takes too long), but using %progress-files%, %total% and %speed-kb% doesn't seem to have effect.

HTML & templates / Re: Update. Phone friendly.
« on: May 26, 2018, 09:15:35 PM »
@Mars: thanks for the explanation! (I've found very interesting how '[+special:alias]' work, especially on how we can combine macro code with an alias (an alias that works almost the same as a 'variable'). It surely gives endless possibilities and makes the code more easy to handle.

@Danny: I've tested the new Throwback7.tpl and this is getting better and better (that gradient background looks great). By the way, I don't see any more enhancements available without slowing down the server, so, it's done for me, at least for now.


The table can't have every col as a % because then the delete button won't appear.  On the phone, it is intentionally expanded off the right side, when the phone is held vertical; and that's because it is more important to see the filenames than to have the table stay within the bounds of the screen (especially 5cm screen).
@Danny: I agree, my mistake, sorry, I didn't have enabled the delete button when doing edits (take all this like my customized and very experimental version, you don't have to incorporate my changes to your version, which is already working great).

I choose to cut file names, because I usually have very long file names and they look like a mess on small screens. With JavaScript, I was also planning to use the tag 'title' to show the complete filename on mouse over, but on phones I guess that won't work).

To show %item-modified% as MM/DD/YYYY, change this:
%item-modified% this:


@BMartino1: I was thinking in adding a "Parent Directory" item (like another item on the file list), at the top of the file list (except on root), like Apache usually does. See how this works, on this live example:

I still have to see how to hide columns on small screen sizes (too much work for today, perhaps I'll do it on the next few days)

(I've uploaded a new revision, here. Report any bugs, if you find them)

Small enhancements:

Throwback6x.tpl - Change log:
- Font smoothing
- One line per file
- New background color

Throwback6y.tpl - Change log:
- New transparent delete button.
- Now displays only the file date
- Small tweaks on column width
Still missing:

- Hides columns if screen is small
- Use divs instead of tables? (info)
- "Parent Directory" like apache has.

(Feel free to fix/enhance it, if you find something wrong)


@Rejetto: There is no hurry for me, take all the time you need before publishing a new stable version (I also confirm that the 'remote upload' feature works perfect now on this new build). :)

@Mars: Your code posted here works fine with local files (and with small changes on the code, also with external files).

» EDIT: I'm currently doing several tests...
(I'll post the results on the next few days).

I didn't have the chance to test 'Throwback4.tpl' (perhaps you could attach it on this message if you want), but 'TB5.tpl' works great and fast. :)

@Rejetto: Mars's bugfix is a nice opportunity to officially release (along with the source code) the long-awaited 'stable' release v2.3l Build #300, which will also be the first stable release featuring the multi-language support (that you have published as beta test build, five months ago here, along with another bugfixes here).

(there is no hurry, it's only a suggestion.. ;) )

HFS ~ HTTP File Server / Re: visibility based on user permissions
« on: May 21, 2018, 06:06:22 PM »
» You can do it this way:

- Right click on the home / icon > Properties...
- Then click on 'Manage accounts', make some users/pass and click OK.
- Then back on the 'Properties' window, and check on the users you made.
- Click OK to apply the changes, and it's done.

Now every time someone visits your site, it will ask an user and password (if some visitor doesn't have it, it will show an 'Unauthorized' message).

Your question is somewhat related to this question. Currently, there is no 'classic' login form, like most websites have (HFS has only implemented a basic auth pop-up).

» EDIT: I was writing my answer while Mars was answering you (his answer is the most appropriate and easy way to do it :) )

HTML & templates / Remote upload: now it writes an empty file
« on: May 20, 2018, 01:30:41 AM »
I was almost sure your changes would work, until I've tested it (and it doesn't work). The endless loop was solved, but now it writes an empty file (in the log shows "saved file contain 0 bytes"). The same goes using a remote file.

I've tried using any of these url formats (one at time), but with same result.
Code: [Select]
<input name='url' value="">
<input name='url' value="">
<input name='url' value="">

...and I've tried even using:
Code: [Select]
<input name='url' value="">
<input name='url' value="">

But the log always show...
Code: [Select]
Requested GET /HFS/
loading from '/HFS/'
saved file contain 0 bytes
Requested POST /HFS/

...and it writes an empty file ( or whatever filename you use). I've tried changing folder settings permissions (allowing everything), and I double checked everything (even starting with a new configuration file on 2 different machines), but always with the same results.

I also tried using #global variables, running it in the "HFS > Debug > Run script..." window (as described here), with the same result (an empty file).

Rejetto said (in 2009): "this requires some bugfixes available in #248 that i'm going to publish now.". Could be possible he forgot to apply those bugfixes on that release?... ???

...or what else could be?... :-\

Pages: [1] 2 3 ... 29