A system and method is provided for reliably detecting the file type of a
client-requested and by-passing conventional ICAP processing if the
detected file type corresponds to a non-viral file. The client-requested
file is examined to determine whether it contains a predefined byte
pattern (or "file signature") corresponding to a non-viral type. The
signature may be embodied as one or more predetermined "magic bytes"
located at known offsets. For instance, the client-requested may be
identified as a particular type of image file if it contains the set of
magic bytes associated with that image format. Unlike prior
implementations, when the client-requested file is determined to contain
magic bytes corresponding to a non-viral file type, such as an image
file, the file is returned to the requesting client without performing
conventional ICAP virus-scanning operations.