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.


Messages - LeoNeeson

Pages: 1 ... 26 27 28 29 30 ... 56
406
HTML & templates / Re: Need help with file delete feature.
« on: June 02, 2018, 04:22:36 AM »
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.

Example:
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... :-[

407
HFS ~ HTTP File Server / Re: HFS Network Storage Integration
« on: June 02, 2018, 04:22:10 AM »
@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.

408
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...

409
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).

410
HFS ~ HTTP File Server / Re: Why a session is limited to 1GB?
« on: May 28, 2018, 04:50:19 AM »
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.

411
See if this post helps you.

412
HTML & templates / [Testing] Remote upload (Macro)
« on: May 27, 2018, 04:06:25 AM »
@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):
Quote
10:25:05 127.0.0.1:1281 Requested GET /
10:25:13 127.0.0.1:1281 loading from 'http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso' 13256704 bytes
10:25:34 127.0.0.1:1281 chunk=10000000 from=0 size=10000000
10:26:08 127.0.0.1:1281 chunk=3256704 from=10000000 size=3256704
10:26:09 127.0.0.1:1281 saved file contain 13256704 bytes
10:26:09 127.0.0.1:1281 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)
Quote
10:36:05 127.0.0.1:1257 Requested GET /
10:36:17 127.0.0.1:1257 loading from 'http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso' 13256704 bytes
10:36:53 127.0.0.1:1257 chunk=10000000 from=0 size=10000000 > Connection dropped!
10:37:16 127.0.0.1:1269 loading from 'http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso' 13256704 bytes
10:37:38 127.0.0.1:1269 chunk=10000000 from=0 size=10000000
10:37:47 127.0.0.1:1269 chunk=3256704 from=10000000 size=3256704
10:37:48 127.0.0.1:1269 saved file contain 13256704 bytes
10:37:48 127.0.0.1:1269 Requested POST /
10:37:48 127.0.0.1:1257 chunk=3256704 from=10000000 size=3256704 > WTF!?
10:37:49 127.0.0.1:1257 saved file contain 13256704 bytes > Not true, file was bigger, (exactly 16513408 bytes)!
10:37:49 127.0.0.1:1257 Requested POST /

Code used (RemoteUpload3.tpl):
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.iso">
<br><input type='submit'>
</form>
{.set|url|{.postvar|url.}.}
{.break|if={.not|{.^url.}.}.}
{.set|dest|{.or|{.filename|{.postvar|dest.}.}|{.filename|{.^url.}.}|downloaded.}.}
{.delete|{.^dest.}.}
{.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.}
{.set|from|0.}
{.save|{.^dest.}|.}
{.comment| define CHUNK with the min size, if nul then WHILE is never executed.}
{.set|chunk|{.min|{.filesize|{.^url.}.}|10000000.}.}
{.while|chunk|{:
   {.load|{.^url.}|from={.^from.}|var=data|size={.^chunk.}.}
   {.add to log| chunk={.^chunk.} from={.^from.} size={.length|var=data.}.}
   {.if|{.length|var=data.}
      |   {:
         {.append|{.^dest.}|var=data.}{.inc|from|{.length|var=data.}.}
         {.comment| redefine CHUNK with the min size, if nul then WHILE is stoped.}
         {.set|chunk|{.min|{.^chunk.}|{.sub|{.filesize|{.^url.}.}|{.^from.}/sub.}.}.}
         :}
      | {:{.set|chunk|0.}:}
   /if.}:}
   |timeout=0
   |else={:{.add to log|Error during WHILE.}
   :}/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.

413
HTML & templates / Re: Update. Phone friendly.
« on: May 27, 2018, 03:15:35 AM »
@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.

Cheers,
Leo.-

414
@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.

Cheers,
Leo.-

415
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%

...to this:
{.cut|1|10|%item-added%.}

(Source)



@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: https://unicode.org/Public/emoji/



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)

416
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)

Cheers,
Leo.-

417
@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).
;)

418
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. :)

419
@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.. ;) )

420
HFS ~ HTTP File Server / Re: visibility based on user permissions
« on: May 22, 2018, 12:06:22 AM »
» 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 :) )

Pages: 1 ... 26 27 28 29 30 ... 56