function uploadFile($index, $file) { $targetDir = $this->getTargetDir($index); WebDAV::upload_from_file($file, $targetDir . '/' . basename($file)); }