yii\mongodb\file\Download::toFile PHP Méthode

toFile() public méthode

Saves download to the physical file.
public toFile ( string $filename ) : integer
$filename string name of the physical file.
Résultat integer number of written bytes.
    public function toFile($filename)
    {
        $filename = Yii::getAlias($filename);
        FileHelper::createDirectory(dirname($filename));
        return $this->toStream(fopen($filename, 'w+'));
    }