\SecureFileController
Handles requests for secure files by url.
- Author: Hamish Campbell <hn.campbell@gmail.com>
- Copyright: copyright (c) 2010, Hamish Campbell
Synopsis
class SecureFileController
extends Controller
implements
PermissionProvider
{
- // members
- public static array $allowed_actions = ;
- protected static string $htaccess_file = '.htaccess';
- protected static integer $chunck_size_kb = 32;
- protected static bool $use_x_sendfile = false;
- protected static bool $use_ss_sendfile = false;
- protected static array $i18n_not_authorized = ;
- protected static array $i18n_not_found = ;
- // methods
- public static void use_x_sendfile_method()
- public static void use_ss_sendfile_method()
- public static void use_default_sendfile_method()
- public static void set_chunk_size()
- public static void set_access_filename()
- public static string get_access_filename()
- public static void set_not_authorized_text()
- public static void set_not_found_text()
- protected HTTPResponse handleAction()
- public HTTPResponse fileNotFound()
- public HTTPResponse fileNotAuthorized()
- public void fileFound()
- public void flush()
- public array providePermissions()
Hierarchy
Extends
- Controller
Implements
- PermissionProvider
Members
protected
- $chunck_size_kb — int
- $htaccess_file — string
- $i18n_not_found — array
- $use_ss_sendfile — bool
- $use_x_sendfile — bool
public
- $allowed_actions — array
Methods
protected
- handleAction() — Process incoming requests passed to this controller.
public
- fileFound() — File found response.
- fileNotAuthorized() — File not authorized response.
- fileNotFound() — File Not Found response.
- flush() — Flush the output buffer to the server (if possible).
- get_access_filename() — Get the Apache access file name.
- providePermissions() — Permission provider for access to secure files.
- set_access_filename() — Set the Apache access file name (.htaccess by default) as determined by the AccessFileName Apache directive.
- set_chunk_size() — Set the size of upload chunk in bytes.
- set_not_found_text() — Set a 'not found' message to replace the standard string.
- use_default_sendfile_method() — Use the default chuncked file method to send files to the browser.
- use_ss_sendfile_method() — Use internal SilverStripe to send files to the browser.
- use_x_sendfile_method() — Use X-Sendfile headers to send files to the browser.