\SecureFileController
Handles requests to a file path, checking if the file can be viewed given it's access settings.
will determine whether the file
can be served, by checking See for how the access file is setup in a secured directory.
Synopsis
class SecureFileController
extends Controller
{
- // members
- private static integer $min_download_bandwidth = 50;
- private static string $content_disposition = 'attachment';
- // methods
- public void handleRequest()
- protected mixed disableFilters()
- public bool|string|void sendFile()
- public void canDownloadFile()
- public File|null find()
Hierarchy
Extends
- Controller
Members
private
- $content_disposition — string
- $min_download_bandwidth
Methods
protected
- disableFilters() — Execute a method with any filters disabled (Subsites, etc)
public
- canDownloadFile()
- find() — Case-sensitive version of File::find(). This is used because case-sensitive file systems can have files at both upload.jpg and upload.JPG. Without this change, we always return the first of those files no matter what. SS *shouldn't* allow two files to be uploaded with the same (case insensitive) filename, but it does.
- handleRequest() — Process all incoming requests passed to this controller, checking that the file exists and passing the file through if possible.
- sendFile() — Output file to the browser