Fix filepath

pull/1/head
Victor Dubiniuk 11 years ago committed by Tobias Hintze
parent 412d07dedc
commit 778378b570

@ -20,7 +20,7 @@
<default></default>
<notnull>true</notnull>
<length>512</length>
<comments>Relative to storage e.g. /welcome.odt</comments>
<comments>Relative to owner office storage /welcome.odt</comments>
</field>
<field>
<name>genesis_hash</name>
@ -28,6 +28,14 @@
<notnull>true</notnull>
<comments>To be sure the genesis did not change</comments>
</field>
<field>
<name>document_path</name>
<type>text</type>
<default></default>
<notnull>true</notnull>
<length>512</length>
<comments>Relative to storage e.g. /welcome.odt</comments>
</field>
<field>
<name>owner</name>
<type>text</type>

@ -34,8 +34,9 @@ class View extends \OC\Files\View{
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$newName = '/' . self::getHashByGenesis($uid, $path) . '.odt';
$view = new \OC\Files\View('/' . $uid);
$newName = '/' . sha1($view->file_get_contents('/files' . $path)) . '.odt';
$view->copy('/files' . $path, self::OFFICE_DIRNAME . $newName);
\OC_FileProxy::$enabled = $proxyStatus;
return $newName;

Loading…
Cancel
Save