Created
May 15, 2018 12:19
-
-
Save v1talii-dev/91d82469ba99456781ad78e3e2d4c1b1 to your computer and use it in GitHub Desktop.
D8: get file real path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = File::load($file_id); | |
$uri = $file->getFileUri(); | |
$stream_wrapper_manager = \Drupal::service('stream_wrapper_manager')->getViaUri($uri); | |
$file_path = $stream_wrapper_manager->realpath(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment