Hey there,
I am new to Nextcloud
Part of what my app does is keeping metadata for files or dirs. The user launches a small editor from the fileList to edit the file/dir metadata.
I decided to take a lead from the Comments app I associate the metadata of a file/dir to its fileid. I get the fileid from the context the fileList supplies during the front end interaction.
When the user initiates the action to save their metada, in the back-end I need to use some information, such as the mime type. I try getting it from the FileInfo.
Right now I get the FileInfo this way:
use OC\Files\Filesystem;
$path = Filesystem::getPath($fileid);
$info = Filesystem::getFileInfo($path);
Question: Should I be doing it differently? If so, any hints?
Thanks!
Update:
So, I followed the advice from @nickvergessen from a previous post:
$a = \OC::$server->getRootFolder()->getById($objectid);
which returned me an array of \OCP\FIles\Folder
which extends \OCP\FIles\Node
which extends \OCP\Files\FileInfo
which has what I need.
Thanks! (again)