protected function createNewFile() { $tmpFile = CWebDavTmpFile::buildFromDownloaded($_FILES['file']); if (!$tmpFile->save()) { throw new Exception('Error in DB'); } return $tmpFile; }