rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: vbn on August 18, 2010, 10:09:47 AM

Title: Refuse File Download
Post by: vbn on August 18, 2010, 10:09:47 AM
OK...Now I know the filters concept...but my setup as just the root folder setup as "Real Folder" and there are MANY folders and files served from within it....Many people have put their image files (jpg/png) and serving through HFS which causes lot of connections

How do I restrict HFS to allow only certain file types to be downloaded (or vice versa) ... not just hide them because people have direct links to these images in forums and causes lots of connections during peak time
Title: Re: Refuse File Download
Post by: vbn on August 24, 2010, 06:06:17 AM
Bump ... nobody any clue ?  :(
Title: Re: Refuse File Download
Post by: r][m on August 24, 2010, 07:03:32 AM
In version 266,
Right click folder in vfs > Properties > Flags > check "No Download" ?
Or remove the user's access to these files/folders in Permissions
Title: Re: Refuse File Download
Post by: rejetto on August 26, 2010, 11:28:06 AM
if you can't flag them with "no download" because they are in real folder, then you can use a short script, but this requires you to be using version 2.3

press ALT+F6 and add this little script

[+download]
{.disconnection reason|Forbidden file|if={.match|*.jpg.}.}
Title: Re: Refuse File Download
Post by: vbn on August 27, 2010, 08:08:42 AM
I added the following in for png files :

[+download]
{.disconnection reason|Forbidden file|if={.match|*.png.}.}

...but HFS is still serving them...is it supposed to restart to take in effect ?
Title: Re: Refuse File Download
Post by: r][m on August 27, 2010, 02:02:50 PM
Code: [Select]
[+download]
{.disconnection reason|Forbidden file|if={.match|*.jpg.}.}

Works great when added to hfs.events in 2.3 beta 266 here, no
restart needed, just save the change to hfs.events

Quote
Right click folder in vfs > Properties > Flags > check "No Download" ?
Or remove the user's access to these files/folders in Permissions
Works here as well
Title: Re: Refuse File Download
Post by: rejetto on August 27, 2010, 04:54:14 PM
did you press ALT+F6 ?
did a new window appear?
are you using version 2.3 ?
Title: Re: Refuse File Download
Post by: SilentPliz on August 27, 2010, 05:15:23 PM
Code: [Select]
[+download]
{.disconnection reason|Forbidden file|if={.match|*.jpg.}.}

I just tried this script ... for me also it does not work.

This seems to block the event [+download completed] but the files are still downloaded & downloadable.
Title: Re: Refuse File Download
Post by: rejetto on August 28, 2010, 11:21:48 AM
whoops, the script is wrong :)
use this


[+download]
{.disconnection reason|Forbidden file|if={.match|*.png|%url%.}.}