UploadMaxSizeException example

$checkRequest = $args->getRequest()->isPost() || $args->getRequest()->isPut();
        $exceptionAlreadyThrown = $this->hasUploadMaxSizeExceptions($args->getResponse());

        if (!$checkRequest || $exceptionAlreadyThrown) {
            return;
        }

        if (!$this->hasPostMaxSizeBeenExceeded($args->getRequest())) {
            return;
        }

        throw new UploadMaxSizeException();
    }

    /** * Returns true if the POST max size has been exceeded in the request. * * @return bool */
    public function hasPostMaxSizeBeenExceeded(Enlight_Controller_Request_Request $request)
    {
        $contentLength = $request->getServer('CONTENT_LENGTH');
        $maxContentLength = $this->getPostMaxSize();

        
Home | Imprint | This part of the site doesn't use cookies.