PHP 클래스 Symfony\Component\HttpFoundation\BinaryFileResponse

저자: Niklas Fiekas ([email protected])
저자: stealth35 ([email protected])
저자: Igor Wiedler ([email protected])
저자: Jordan Alliot ([email protected])
저자: Sergey Linnik ([email protected])
상속: extends Response
파일 보기 프로젝트 열기: symfony/http-foundation 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$deleteFileAfterSend
$file Symfony\Component\HttpFoundation\File\File
$maxlen
$offset
$trustXSendfileTypeHeader

공개 메소드들

메소드 설명
__construct ( SplFileInfo | string $file, integer $status = 200, array $headers = [], boolean $public = true, null | string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true ) Constructor.
create ( SplFileInfo | string $file = null, integer $status = 200, array $headers = [], boolean $public = true, null | string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true ) : BinaryFileResponse
deleteFileAfterSend ( boolean $shouldDelete ) : BinaryFileResponse If this is set to true, the file will be unlinked after the request is send Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used.
getContent ( ) : false
getFile ( ) : File Gets the file.
prepare ( Request $request )
sendContent ( ) Sends the file.
setAutoEtag ( ) Automatically sets the ETag header according to the checksum of the file.
setAutoLastModified ( ) Automatically sets the Last-Modified header according the file modification date.
setContent ( $content )
setContentDisposition ( string $disposition, string $filename = '', string $filenameFallback = '' ) : BinaryFileResponse Sets the Content-Disposition header with the given filename.
setFile ( SplFileInfo | string $file, string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true ) : BinaryFileResponse Sets the file to stream.
trustXSendfileTypeHeader ( ) Trust X-Sendfile-Type header.

비공개 메소드들

메소드 설명
hasValidIfRangeHeader ( $header )

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( SplFileInfo | string $file, integer $status = 200, array $headers = [], boolean $public = true, null | string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true )
$file SplFileInfo | string The file to stream
$status integer The response status code
$headers array An array of response headers
$public boolean Files are public by default
$contentDisposition null | string The type of Content-Disposition to set automatically with the filename
$autoEtag boolean Whether the ETag header should be automatically set
$autoLastModified boolean Whether the Last-Modified header should be automatically set

create() 공개 정적인 메소드

public static create ( SplFileInfo | string $file = null, integer $status = 200, array $headers = [], boolean $public = true, null | string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true ) : BinaryFileResponse
$file SplFileInfo | string The file to stream
$status integer The response status code
$headers array An array of response headers
$public boolean Files are public by default
$contentDisposition null | string The type of Content-Disposition to set automatically with the filename
$autoEtag boolean Whether the ETag header should be automatically set
$autoLastModified boolean Whether the Last-Modified header should be automatically set
리턴 BinaryFileResponse The created response

deleteFileAfterSend() 공개 메소드

If this is set to true, the file will be unlinked after the request is send Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used.
public deleteFileAfterSend ( boolean $shouldDelete ) : BinaryFileResponse
$shouldDelete boolean
리턴 BinaryFileResponse

getContent() 공개 메소드

public getContent ( ) : false
리턴 false

getFile() 공개 메소드

Gets the file.
public getFile ( ) : File
리턴 Symfony\Component\HttpFoundation\File\File The file to stream

prepare() 공개 메소드

public prepare ( Request $request )
$request Request

sendContent() 공개 메소드

public sendContent ( )

setAutoEtag() 공개 메소드

Automatically sets the ETag header according to the checksum of the file.
public setAutoEtag ( )

setAutoLastModified() 공개 메소드

Automatically sets the Last-Modified header according the file modification date.
public setAutoLastModified ( )

setContent() 공개 메소드

public setContent ( $content )

setContentDisposition() 공개 메소드

Sets the Content-Disposition header with the given filename.
public setContentDisposition ( string $disposition, string $filename = '', string $filenameFallback = '' ) : BinaryFileResponse
$disposition string ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
$filename string Optionally use this filename instead of the real name of the file
$filenameFallback string A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename
리턴 BinaryFileResponse

setFile() 공개 메소드

Sets the file to stream.
public setFile ( SplFileInfo | string $file, string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true ) : BinaryFileResponse
$file SplFileInfo | string The file to stream
$contentDisposition string
$autoEtag boolean
$autoLastModified boolean
리턴 BinaryFileResponse

trustXSendfileTypeHeader() 공개 정적인 메소드

Trust X-Sendfile-Type header.
public static trustXSendfileTypeHeader ( )

프로퍼티 상세

$deleteFileAfterSend 보호되어 있는 프로퍼티

protected $deleteFileAfterSend

$file 보호되어 있는 프로퍼티

protected File,Symfony\Component\HttpFoundation\File $file
리턴 Symfony\Component\HttpFoundation\File\File

$maxlen 보호되어 있는 프로퍼티

protected $maxlen

$offset 보호되어 있는 프로퍼티

protected $offset

$trustXSendfileTypeHeader 보호되어 있는 정적으로 프로퍼티

protected static $trustXSendfileTypeHeader