src/FlexiPeeHP/Priloha.php
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;
    }
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;
    }
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 ; }
Save attachment to file

@param int $attachmentID
@param string $destination directory or filename with path
@return int
Save attachment to file