<?php
/**
 * Handle GetAttachment requests.
 * 
 * Logic adapted from Z-Push, original copyright notices below.
 *
 * Copyright 2009-2012 Horde LLC (http://www.horde.org/)
 *
 * @author Michael J. Rubinsky <mrubinsk@horde.org>
 * @package ActiveSync
 */
/**
 * Zarafa Deutschland GmbH, www.zarafaserver.de
 * This file is distributed under GPL-2.0.
 * Consult COPYING file for details
 */


class Horde_ActiveSync_Request_GetAttachment extends Horde_ActiveSync_Request_Base
{
    /**
     * Handle request
     *
     * @return boolean
     */
    public function handle()
    {
        $get = $this->_request->getGetParams();
        $attname = $get('AttachmentName');
        if (!isset($attname)) {
            return false;
        }

        header("Content-Type: application/octet-stream");
        $this->_driver->GetAttachmentData($attname);

        return true;    }
}