rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: Novox on May 25, 2010, 08:58:01 AM

Title: Disable ZIP download if folder bigger than 2GB?
Post by: Novox on May 25, 2010, 08:58:01 AM
Hello rejetto,

Is it possible, if I want to make an event that disable download as zip's button when the folder is bigger than 2GB?

Thanks in advanced!
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: rejetto on May 29, 2010, 06:15:45 PM
maybe it's possible to make a [download] event where you call a command-line utility to get the size of the archive.
anyway, this is not a good method, because the archive is not necessarily a full folder.
problem is, the [download] event is fired before the archive is calculated (and this must stay this way), so hfs cannot even pass you the size.

i don't know if we should introduce a new event for archives.
opinions?
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: Novox on July 15, 2010, 06:30:44 AM
Yeah, I think a new event for archive is required to solve this problem. Or can you give a archive setting option in HFS instead of using event script?
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: rejetto on July 27, 2010, 08:10:39 AM
i found that event [archive name] is when the archive is ready.
so i just introduced a new symbol %stream-size% so you can now ALT+F6 and put this

[+archive name]
{.if|{.%stream-size% > 2000000000.}|{:
  {.disconnect reason|archive too big.}
:}.}
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: Novox on July 27, 2010, 08:42:38 AM
WoW Thank you very much rejetto! You are the best!

This will come in the new b263 right? I waiting for it :)
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: rejetto on July 27, 2010, 01:57:34 PM
yes
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: DAD1977 on April 23, 2015, 12:17:42 PM
Hallo, rejetto.

The use of scripts is very helpful in the work site.
I want to put a limit to download as a tar-file folders larger than 2 GB.
But the above script does not work .
[+archive name]
{.if|{.%stream-size% > 2000000000.}|{:
  {.disconnect reason|archive too big.}
:}.}
I experimented with a limit of 2 MB.
Function %stream-size% produces a result of "0".
As a result, disconnect does not occur and the tar-file is downloaded.

I use  build 293.

Thanks.
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: rejetto on May 01, 2015, 02:36:48 PM
i don't remember if it ever worked and why, anyway at the moment of [archive] the download is not ready and the size is not known, so it is currently normal that it doesn't work.
I had to introduce a new event [stream ready]
and to know if a download is an archive you can now use %is-archive%

So, the result shall be

[+stream ready]
{.if|{.and| %is-archive% | {.%stream-size% > 2000000000.} .}|{:
  {.disconnect reason|archive too big.}
:}.}


But this will work only with next release, version 2.3f
and be careful as i didn't test it :P would you? this is a preview http://ge.tt/1kuGSaF2/v/0
if you give me your ok i will publish it
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: DAD1977 on May 05, 2015, 07:37:08 PM
Hallo.
This script is not working. I try your option:
... > 2000000 ...
conversely
... < 2000000 ...
and experimented with script:
Code: [Select]
[+ stream ready]
{.if | {.% is-archive%.} | {:
  {.disconnect reason | archive too big.}
} . }
and
Code: [Select]
[+ stream ready]
{.if | {.% stream-size%> 2000000 .} | {:
  {.disconnect reason | archive too big.}
} . }

But the result is not available; HFS did not respond to the script; restart HFS does not work too.
I used:
- Windows 8.1 with IE11 and Mozilla 29
- Windows XP SP3 with IE8 and Mozilla 9

my opinion: limit the size of the archive is very important, because a many long time (~30 hours) multiple simultaneous downloads use a lot of RAM. Usually, I get an error "Out of memory" when the size of the allocated RAM for HFS is about 1.8 GB.

P.S.: There is a wish:  in HFS box with info about current connections add the ability to sort the data in columns: IP-address, File, Time.....  This function helps quickly navigate the data, when more than 20 downloads in window HFS.

Thank you for the program.
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: Mars on May 06, 2015, 11:12:58 PM
@rejetto
[stream ready] is  not defined in sources as Event
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: SilentPliz on May 11, 2015, 11:40:32 AM
Hi!

@Mars

Ce sera pour la version 2.3f, rejetto lui poste juste une version de test pour le moment.
++


But this will work only with next release, version 2.3f
and be careful as i didn't test it :P would you? this is a preview http://ge.tt/1kuGSaF2/v/0
if you give me your ok i will publish it
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: Mars on May 11, 2015, 08:24:45 PM
hi Silent
comme tu peux le constater, la vieillesse s'installe aussi chez moi, j'avais pas lu la fin du message de maximo ;)
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: DAD1977 on May 13, 2015, 08:08:36 AM
But this will work only with next release, version 2.3f
and be careful as i didn't test it :P would you? this is a preview http://ge.tt/1kuGSaF2/v/0
if you give me your ok i will publish it

I realized that this was a reference to the test version 2.3f with [stream ready]. This version I downloaded and tested, but [stream ready] not worked.
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: rejetto on May 17, 2015, 11:58:16 PM
there was a typo in my script.
anyway, there's still a problem that i have to fix (no error page is supplied) before releasing a new version.
this is the corrected script:

[+stream ready]
{.disconnection reason|archive too big|if={.and| %is-archive% | {.%stream-size% > 2000000000.} .}.}
Title: Re: Disable ZIP download if folder bigger than 2GB?
Post by: rejetto on May 18, 2015, 10:35:57 AM
ok, i also fixed the bug.
this is the new experimental exe
http://ge.tt/7esYeaG2/v/0