Drupal 8  8.0.2
FileDownloadController Class Reference
Inheritance diagram for FileDownloadController:

Public Member Functions

 download (Request $request, $scheme= 'private')

Detailed Description

System file controller.

Member Function Documentation

download ( Request  $request,
  $scheme = 'private' 

Handles private file transfers.

Call modules that implement hook_file_download() to find out if a file is accessible and what headers it should be transferred with. If one or more modules returned headers the download will start with the returned headers. If a module returns -1 an AccessDeniedHttpException will be thrown. If the file exists but no modules responded an AccessDeniedHttpException will be thrown. If the file does not exist a NotFoundHttpException will be thrown.

See Also
\Symfony\Component\HttpFoundation\Request$requestThe request object.
string$schemeThe file scheme, defaults to 'private'.
The transferred file as response.
\Symfony\Component\HttpKernel\Exception\NotFoundHttpExceptionThrown when the requested file does not exist.
\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpExceptionThrown when the user does not have access to the file.

References file_stream_wrapper_valid_scheme(), and Drupal\moduleHandler().

Here is the call graph for this function:

The documentation for this class was generated from the following file: