File Type Filter

File Type Filter recognizes content types (file formats) and blocks downloads of undesirable formats. It may be used to prevent your children (or employees) from downloading potentially harmful executable files, archives that may contain executables, or waste bandwidth by downloading audio and video files.

Even if you are the only user of your Foxy server, it may still make sense to enable this filter to prevent your browser from sneaky virus downloads due to security flaws exploited by malicious websites (dodn't forget to disable it temporarily before downloading ligitimate executables).

File Type Filters can block content by either or both HTTP Content-Type headers (which are often missing or incorrect) and the actual file format. File Type Filters anylise first bytes of the file itself in order to determine file format (before starting streaming to the client). The drawback is that Foxy has to receive at least one packet before it can determine the format (usually it's exactly one packet).

Why both methods of format recognition are needed?

Parameters

block_xxx

Set to true to block downloads of specific file types.

Format:

block_executables = boolean
block_archives = boolean
block_java = boolean
block_javascript = boolean
block_audio = boolean
block_video = boolean
block_animations = true
block_images = boolean

Some of the supported formats:

Executablesexe, bat
Archivespkzip, gzip, rar, arj
Audiomp3, wav, wma, ogg
Videoavi, mpg, mov, wmv
Imagesjpg, gif, png, bmp, wmf
Animationswf

content_type

One or more content_type parameters define a set of content types this instance of the filter will block.

Here are some examples of common content types:

*/* All content types. If this value is included, the filter is equivalent to Blacklist filter (blocks everything).
image/* All image content types.
image/gif GIF images.
image/jpeg JPEG images.
image/png PNG images.
application/x-shockwave-flash Shockwave aminations.
text/* All text content types.
text/html HTML.
text/javascript Javascript. If this value is included, the filter is equivalent to a simplified version of Script Filter, but will handle only external scripts (<script src="..."/>) and alow built-in scripts (<script>...</script>).

keep_same_domain

Set to true to allow selected file types when they are referenced from the same domain. E.g. you may want to block all immages from banners.com when they are referenced from another domain (that is actual banners), but you want to keep them when actually visiting http://www.banners.com (to preserve navigation buttons, etc.)

Format:

keep_same_domain = boolean

action

The action parameter defines method of access blocking.

Format:

action = disconnect
action = redirect:URL

See also Common Filter Parameters.

Example

The following filter will block images:

type = File Type Filter
name = Image Blocker
enabled = true
logging = true
block_images = true
include = *
action = redirect:null.gif

This filter will block movies:

type = File Type Filter
name = Video Blocker
enabled = true
logging = true
block_video = true
include = *
action = redirect:blocked.html

Be creative. Create separate File Type Filters for different file types. Redirect the filter blocking audio to a recorded file with a message from CEO explaining why employees are not supposed to download music. Do the same for other file types. Don't forget to add the management to user exception lists.