src/Koldy/Response/FileDownload.php
public static function create(string $path, string $asName = null, string $contentType = null): FileDownload
    {
        $self = new static(new File($path));

        if ($asName !== null) {
            $self->setAsName($asName);
        }

        if ($contentType !== null) {
            $self->setContentType($contentType);
        }

        return $self;
    }
public static function create(string $path, string $asName = null, string $contentType = null): FileDownload
    {
        $self = new static(new File($path));

        if ($asName !== null) {
            $self->setAsName($asName);
        }

        if ($contentType !== null) {
            $self->setContentType($contentType);
        }

        return $self;
    }
public static function create ( string $ path , string $ asName = null , string $ contentType = null ) : FileDownload { $ self = new static ( new File ( $ path ) ) ; if ( $ asName !== null ) { $ self -> setAsName ( $ asName ) ; } if ( $ contentType !== null ) { $ self -> setContentType ( $ contentType ) ; } return $ self ; }
Return file download

@param string $path
@param string $asName [optional]
@param string $contentType [optional]

@throws Exception
@return FileDownload
Return file download