Create file alias using API

Create file alias using API

per Евгений Мамаев -
Nombre de respostes: 1
Imatge Plugin developers

I have a file in a course. I need to create an alias of this file in another course using File API.

Can anyone give me a hint on this?

Mitjana de qualificacions: -
En resposta a Евгений Мамаев

Re: Create file alias using API

per Евгений Мамаев -
Imatge Plugin developers
By now I have found a file_storage class in /lib/filestorage/file_storage.php. It has method create_file_from_reference($filerecord, $repositoryid, $reference, $options = array())
$reference is the original file to which I can create a link/alias