Move unused Assets to a specific Folder I would like to create a plugin/function to move all unused assets (which are not related to a entry) to a specific folder in the same assets source. Now i try to create the function to move a single file by referring the id of the file. But i get always errors... The function should look like this:

public function moveFileToFolder($fileId,$idOfTargetFolder,$assetSourceId) {
 ....
}


Thanks for any help!
I found the solution: The moveFiles function provide the function to move a file:

/**
* Move or rename files.
*
* @param        $fileIds
* @param        $folderId
* @param string $filename If this is a rename operation or not.
* @param array  $actions  Actions to take in case of a conflict.
*
* @throws Exception
* @return bool|AssetOperationResponseModel
*/

public function moveFiles($fileIds, $folderId, $filename = '', $actions = array())


So for me the following code works to move the file with the id 21 to the folder with the id 3: 

craft()-&gt;assets-&gt;moveFiles([21], 3,'', "keepBoth");