![]() File core/lib/Drupal/Core/File/, line 31 Hooks related to the File management system. See alsoįile_download() Related topics Hooks Define functions that alter the behavior of Drupal core. Changes since 8.x-2. For more documentation read the Official Guides, Community Guides, and Drupal API Reference. Important update information If you are upgrading to this release from 8.7.x or earlier, read the Drupal 8.8.0 release notes before upgrading to this release. After your Drupal installation is up and running, learn how to plan, extend, and customize a Drupal 8 application by reading the Drupal User Guide. If the file is not controlled by the current module, the return value should be NULL. Drupal 10 compatibility Contributors (5) Alina Basarabeanu, Berdir, JeroenT, Project Update Bot, bgilhome Changelog Issues: 2 issues resolved. This is a patch release of Drupal 8 and is ready for use on production sites. If the user has permission, return an array with the appropriate headers. If the user does not have permission to access the file, return -1. Modules can also provide headers to specify information like the file's name or MIME type. This hook allows modules to enforce permissions on file downloads whenever Drupal is handling file download, as opposed to the web server bypassing Drupal and returning the file from a public directory. Since I posted this, I changed my code radically where I no longer use the PHP method above but instead rely on the following Drupal 8 APIs: 1. This hook allows modules to enforce permissions on file downloads whenever Drupal is handling file download, as opposed to the web server bypassing Drupal and returning the file from a public directory. Function hook_file_download hook_file_download( $uri)Ĭontrol access to private file downloads and specify HTTP headers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |