I'm currently using this to check if the request is an ajax request:
if ( ! Request::$is_ajax || Request::instance() == $this->request)
if ( ! Request::$is_ajax)
Request::instance() === $this->requestis TRUE. Use this condition for HMVC calls.
$_SERVER['HTTP_X_REQUESTED_WITH'] == 'xmlhttprequest'condition is TRUE. Check your client headers (with firebug for example), maybe your JS doesnt send this header. Or, may be you are using flash uploader?