public static function fromHttpRequest(PartInterface $httpPart)
    {

        // create a temporary filename
        $httpPart->write($tmpFilename = tempnam(ini_get('upload_tmp_dir'), 'tmp_'));

        // initialize the servlet part instance
        $servletPart = new Part();
        $servletPart->setName($httpPart->getName());
        $servletPart->setFilename($httpPart->getFilename());
        $servletPart->setTmpFilename($tmpFilename);

        // initialize the headers the the size
        $servletPart->headers = $httpPart->getHeaders();
        $servletPart->size = $httpPart->getSize();

        // return the servlet part instance
        return $servletPart;
    }