0

There are a few fields that uses public upload destination. I changed it globally right now, as far as I know it uses private upload destination from now. But how can I change previously uploaded files' upload destination (programmatically)?

0

1 Answer 1

0
$dest = 'private://';
$file = file_move($file, $dest)

Change individual file from public to private and vice-versa

2
  • Hey Jimmy, thanks for your contribution. Could you maybe add some more explanation. As link-only or code-only answers are discouraged.
    – leymannx
    Commented Dec 16, 2018 at 8:07
  • The linked answer is for D7. OP asks for D8.
    – leymannx
    Commented Dec 16, 2018 at 13:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.