Create file alias using API

Create file alias using API

by Евгений Мамаев -
Number of replies: 1
Picture of 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?

Average of ratings: -
In reply to Евгений Мамаев

Re: Create file alias using API

by Евгений Мамаев -
Picture of 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