public static function saveToFile($attachmentID, $destination)
    {
        $result     = 0;
        $downloader = new Priloha($attachmentID);
        if ($downloader->lastResponseCode == 200) {

            $downloader->doCurlRequest(self::getDownloadURL($downloader), 'GET');
            if ($downloader->lastResponseCode == 200) {
                if (is_dir($destination)) {
                    $destination .= '/'.$downloader->getDataValue('nazSoub');
                }
                $result = file_put_contents($destination,
                    $downloader->lastCurlResponse);
            }
        }
        return $result;
    }