protected function checkUrlExistsAndSize($fileUri, array $mediaFileInfo)
    {
        $mediaFileInfo['url'] = $fileUri;
        //File is a URL. Create a curl connection but DON'T download the body content
        //because we want to see if file is too big.
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, "$fileUri");
        curl_setopt($curl, CURLOPT_USERAGENT,
            "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11");
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_HEADER, false);
        curl_setopt($curl, CURLOPT_NOBODY, true);

        if (curl_exec($curl) === false) {
            return false;
        }

        //While we're here, get mime type and filesize and extension
        $info                           = curl_getinfo($curl);
        $mediaFileInfo['filesize']      = $info['download_content_length'];
        $mediaFileInfo['filemimetype']  = $info['content_type'];
        $mediaFileInfo['fileextension'] = pathinfo(parse_url($mediaFileInfo['url'], PHP_URL_PATH), PATHINFO_EXTENSION);
        curl_close($curl);

        return $mediaFileInfo;
    }