src/helpers/Storage.php
public static function moveFileToFolder($fileId, $folderId)
    {
        $file = StorageFile::findOne($fileId);
        
        if ($file) {
            $file->updateAttributes(['folder_id' => $folderId]);
            Yii::$app->storage->flushArrays();
            return true;
        }
        
        return false;
    }
public static function moveFileToFolder($fileId, $folderId)
    {
        $file = StorageFile::findOne($fileId);
        
        if ($file) {
            $file->updateAttributes(['folder_id' => $folderId]);
            Yii::$app->storage->flushArrays();
            return true;
        }
        
        return false;
    }
public static function moveFileToFolder ( $ fileId , $ folderId ) { $ file = StorageFile :: findOne ( $ fileId ) ; if ( $ file ) { $ file -> updateAttributes ( [ 'folder_id' => $ folderId ] ) ; Yii :: $ app -> storage -> flushArrays ( ) ; return true ; } return false ; }
Move a storage file to another folder.

@param string|int $fileId
@param string|int $folderId
@return boolean
Move a storage file to another folder .