/** * @param resource $data * @throws DAV\Exception\Forbidden * @throws \Exception */ function put($data) { if ($this->asset->isAllowed("publish")) { // read from resource -> default for SabreDAV $tmpFile = PIMCORE_SYSTEM_TEMP_DIRECTORY . "/asset-dav-tmp-file-" . uniqid(); file_put_contents($tmpFile, $data); $file = fopen($tmpFile, "r+"); $user = AdminTool::getCurrentUser(); $this->asset->setUserModification($user->getId()); $this->asset->setStream($file); $this->asset->save(); fclose($file); unlink($tmpFile); } else { throw new DAV\Exception\Forbidden(); } }