Created
December 2, 2016 02:42
-
-
Save henrytran9x/b36e30aadeb8568b2b68105dd52033a4 to your computer and use it in GitHub Desktop.
File Managed set permanent in Drupal 8 !
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 | |
/* Load the object of the file by it's fid */ | |
$file = File::load('fid_file'); | |
/* Set the status flag permanent of the file object */ | |
$file->setPermanent(); | |
/* Save the file in database */ | |
$file->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment