Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Download
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Download

Download component

Simplifies the file download/stream process by setting the appropriate headers

Package: blesta\components\download
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/download/download.php
Methods summary
public
# __construct( string $encoding = 'binary' )

Initializes the Download object, sets the default encoding

Initializes the Download object, sets the default encoding

Parameters

$encoding
The download encoding (optional, default binary)
public
# setEncoding( string $encoding )

Overrides the currently set file encoding

Overrides the currently set file encoding

Parameters

$encoding
The file encoding to set for all subsequent streams or downloads
public
# setContentType( mixed $content_type )

Overrides the currently set Content Type for this file

Overrides the currently set Content Type for this file

Parameters

$content_type

A numerically indexed array of content types to set, or a string containing the content type to set

public
# streamFile( string $file, string $file_name = null, string $send_mode = 'file' )

Streams a file out to the standard output stream (e.g. a browser)

Streams a file out to the standard output stream (e.g. a browser)

Parameters

$file
The full path to the file name to be streamed
$file_name
The name to give the file being streamed (defaults to the real file name)
$send_mode

The send mode for the file (file to send normally, xsendfile to send through mod_xsendfile)

public
# streamData( string $file_name, string $data )

Streams the given data to the standard output stream (e.g. a browser)

Streams the given data to the standard output stream (e.g. a browser)

Parameters

$file_name
The name of the file to be streamed
$data
The data to be streamed
public
# downloadFile( string $file, string $file_name = null, string $send_mode = 'file' )

Forces download of a file

Forces download of a file

Parameters

$file
The full path to the file name to be downloaded
$file_name
The name to give the file being downloaded (defaults to the real file name)
$send_mode

The send mode for the file (file to send normally, xsendfile to send through mod_xsendfile)

public
# downloadData( string $file_name, string $data )

Forces download of the given data

Forces download of the given data

Parameters

$file_name
The name of the file to be downloaded
$data
The data to be downloaded
Blesta API documentation generated by ApiGen