Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • AcceptHeader
  • AcceptHeaderItem
  • ApacheRequest
  • BinaryFileResponse
  • Cookie
  • ExpressionRequestMatcher
  • FileBag
  • HeaderBag
  • IpUtils
  • JsonResponse
  • ParameterBag
  • RedirectResponse
  • Request
  • RequestMatcher
  • RequestStack
  • Response
  • ResponseHeaderBag
  • ServerBag
  • StreamedResponse

Interfaces

  • RequestMatcherInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class BinaryFileResponse

BinaryFileResponse represents an HTTP response delivering a file.

Symfony\Component\HttpFoundation\Response
Extended by Symfony\Component\HttpFoundation\BinaryFileResponse
Namespace: Symfony\Component\HttpFoundation
Author: Niklas Fiekas niklas.fiekas@tu-clausthal.de
Author: stealth35 stealth35-php@live.fr
Author: Igor Wiedler igor@wiedler.ch
Author: Jordan Alliot jordan.alliot@gmail.com
Author: Sergey Linnik linniksa@gmail.com
Located at BinaryFileResponse.php
Methods summary
public
# __construct( SplFileInfo|string $file, integer $status = 200, array $headers = array(), boolean $public = true, null|string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true )

Constructor.

Constructor.

Parameters

$file
The file to stream
$status
The response status code
$headers
An array of response headers
$public
Files are public by default
$contentDisposition
The type of Content-Disposition to set automatically with the filename
$autoEtag
Whether the ETag header should be automatically set
$autoLastModified
Whether the Last-Modified header should be automatically set

Throws

InvalidArgumentException
When the HTTP status code is not valid

Overrides

Symfony\Component\HttpFoundation\Response::__construct()
public static Symfony\Component\HttpFoundation\BinaryFileResponse
# create( SplFileInfo|string $file = null, integer $status = 200, array $headers = array(), boolean $public = true, null|string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true )

Parameters

$file
The file to stream
$status
The response status code
$headers
An array of response headers
$public
Files are public by default
$contentDisposition
The type of Content-Disposition to set automatically with the filename
$autoEtag
Whether the ETag header should be automatically set
$autoLastModified
Whether the Last-Modified header should be automatically set

Returns

Symfony\Component\HttpFoundation\BinaryFileResponse
The created response

Overrides

Symfony\Component\HttpFoundation\Response::create()
public Symfony\Component\HttpFoundation\BinaryFileResponse
# setFile( SplFileInfo|string $file, string $contentDisposition = null, boolean $autoEtag = false, boolean $autoLastModified = true )

Sets the file to stream.

Sets the file to stream.

Parameters

$file
The file to stream
$contentDisposition
$autoEtag
$autoLastModified

Returns

Symfony\Component\HttpFoundation\BinaryFileResponse

Throws

Symfony\Component\HttpFoundation\File\Exception\FileException
public Symfony\Component\HttpFoundation\File\File
# getFile( )

Gets the file.

Gets the file.

Returns

Symfony\Component\HttpFoundation\File\File
The file to stream
public
# setAutoLastModified( )

Automatically sets the Last-Modified header according the file modification date.

Automatically sets the Last-Modified header according the file modification date.

public
# setAutoEtag( )

Automatically sets the ETag header according to the checksum of the file.

Automatically sets the ETag header according to the checksum of the file.

public Symfony\Component\HttpFoundation\BinaryFileResponse
# setContentDisposition( string $disposition, string $filename = '', string $filenameFallback = '' )

Sets the Content-Disposition header with the given filename.

Sets the Content-Disposition header with the given filename.

Parameters

$disposition
ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT
$filename
Optionally use this filename instead of the real name of the file
$filenameFallback
A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename

Returns

Symfony\Component\HttpFoundation\BinaryFileResponse
public Symfony\Component\HttpFoundation\Response
# prepare( Symfony\Component\HttpFoundation\Request $request )

Prepares the Response before it is sent to the client.

Prepares the Response before it is sent to the client.

Parameters

$request
A Request instance

Returns

Symfony\Component\HttpFoundation\Response
The current response.

Overrides

Symfony\Component\HttpFoundation\Response::prepare()
public Symfony\Component\HttpFoundation\Response
# sendContent( )

Sends the file.

Sends the file.

Returns

Symfony\Component\HttpFoundation\Response

Overrides

Symfony\Component\HttpFoundation\Response::sendContent()
public Symfony\Component\HttpFoundation\Response
# setContent( mixed $content )

Sets the response content.

Sets the response content.

Parameters

$content
Content that can be cast to string

Returns

Symfony\Component\HttpFoundation\Response

Throws

LogicException
when the content is not null

Overrides

Symfony\Component\HttpFoundation\Response::setContent()
public false
# getContent( )

Gets the current response content.

Gets the current response content.

Returns

false

Overrides

Symfony\Component\HttpFoundation\Response::getContent()
public static
# trustXSendfileTypeHeader( )

Trust X-Sendfile-Type header.

Trust X-Sendfile-Type header.

public Symfony\Component\HttpFoundation\BinaryFileResponse
# deleteFileAfterSend( boolean $shouldDelete )

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.

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.

Parameters

$shouldDelete

Returns

Symfony\Component\HttpFoundation\BinaryFileResponse
Methods inherited from Symfony\Component\HttpFoundation\Response
__clone(), __toString(), closeOutputBuffers(), ensureIEOverSSLCompatibility(), expire(), getAge(), getCharset(), getDate(), getEtag(), getExpires(), getLastModified(), getMaxAge(), getProtocolVersion(), getStatusCode(), getTtl(), getVary(), hasVary(), isCacheable(), isClientError(), isEmpty(), isForbidden(), isFresh(), isInformational(), isInvalid(), isNotFound(), isNotModified(), isOk(), isRedirect(), isRedirection(), isServerError(), isSuccessful(), isValidateable(), mustRevalidate(), send(), sendHeaders(), setCache(), setCharset(), setClientTtl(), setDate(), setEtag(), setExpires(), setLastModified(), setMaxAge(), setNotModified(), setPrivate(), setProtocolVersion(), setPublic(), setSharedMaxAge(), setStatusCode(), setTtl(), setVary()
Constants inherited from Symfony\Component\HttpFoundation\Response
HTTP_ACCEPTED, HTTP_ALREADY_REPORTED, HTTP_BAD_GATEWAY, HTTP_BAD_REQUEST, HTTP_CONFLICT, HTTP_CONTINUE, HTTP_CREATED, HTTP_EXPECTATION_FAILED, HTTP_FAILED_DEPENDENCY, HTTP_FORBIDDEN, HTTP_FOUND, HTTP_GATEWAY_TIMEOUT, HTTP_GONE, HTTP_IM_USED, HTTP_INSUFFICIENT_STORAGE, HTTP_INTERNAL_SERVER_ERROR, HTTP_I_AM_A_TEAPOT, HTTP_LENGTH_REQUIRED, HTTP_LOCKED, HTTP_LOOP_DETECTED, HTTP_METHOD_NOT_ALLOWED, HTTP_MOVED_PERMANENTLY, HTTP_MULTIPLE_CHOICES, HTTP_MULTI_STATUS, HTTP_NETWORK_AUTHENTICATION_REQUIRED, HTTP_NON_AUTHORITATIVE_INFORMATION, HTTP_NOT_ACCEPTABLE, HTTP_NOT_EXTENDED, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_NOT_MODIFIED, HTTP_NO_CONTENT, HTTP_OK, HTTP_PARTIAL_CONTENT, HTTP_PAYMENT_REQUIRED, HTTP_PERMANENTLY_REDIRECT, HTTP_PRECONDITION_FAILED, HTTP_PRECONDITION_REQUIRED, HTTP_PROCESSING, HTTP_PROXY_AUTHENTICATION_REQUIRED, HTTP_REQUESTED_RANGE_NOT_SATISFIABLE, HTTP_REQUEST_ENTITY_TOO_LARGE, HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE, HTTP_REQUEST_TIMEOUT, HTTP_REQUEST_URI_TOO_LONG, HTTP_RESERVED, HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL, HTTP_RESET_CONTENT, HTTP_SEE_OTHER, HTTP_SERVICE_UNAVAILABLE, HTTP_SWITCHING_PROTOCOLS, HTTP_TEMPORARY_REDIRECT, HTTP_TOO_MANY_REQUESTS, HTTP_UNAUTHORIZED, HTTP_UNPROCESSABLE_ENTITY, HTTP_UNSUPPORTED_MEDIA_TYPE, HTTP_UPGRADE_REQUIRED, HTTP_USE_PROXY, HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL, HTTP_VERSION_NOT_SUPPORTED
Properties summary
protected static boolean $trustXSendfileTypeHeader
# false
protected $file
#
protected $offset
#
protected $maxlen
#
protected boolean $deleteFileAfterSend
# false
Properties inherited from Symfony\Component\HttpFoundation\Response
$charset, $content, $headers, $statusCode, $statusText, $statusTexts, $version
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen