Fix filepath
This commit is contained in:
parent
412d07dedc
commit
778378b570
@ -20,7 +20,7 @@
|
|||||||
<default></default>
|
<default></default>
|
||||||
<notnull>true</notnull>
|
<notnull>true</notnull>
|
||||||
<length>512</length>
|
<length>512</length>
|
||||||
<comments>Relative to storage e.g. /welcome.odt</comments>
|
<comments>Relative to owner office storage /welcome.odt</comments>
|
||||||
</field>
|
</field>
|
||||||
<field>
|
<field>
|
||||||
<name>genesis_hash</name>
|
<name>genesis_hash</name>
|
||||||
@ -28,6 +28,14 @@
|
|||||||
<notnull>true</notnull>
|
<notnull>true</notnull>
|
||||||
<comments>To be sure the genesis did not change</comments>
|
<comments>To be sure the genesis did not change</comments>
|
||||||
</field>
|
</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>
|
<field>
|
||||||
<name>owner</name>
|
<name>owner</name>
|
||||||
<type>text</type>
|
<type>text</type>
|
||||||
|
@ -34,8 +34,9 @@ class View extends \OC\Files\View{
|
|||||||
$proxyStatus = \OC_FileProxy::$enabled;
|
$proxyStatus = \OC_FileProxy::$enabled;
|
||||||
\OC_FileProxy::$enabled = false;
|
\OC_FileProxy::$enabled = false;
|
||||||
|
|
||||||
$newName = '/' . self::getHashByGenesis($uid, $path) . '.odt';
|
|
||||||
$view = new \OC\Files\View('/' . $uid);
|
$view = new \OC\Files\View('/' . $uid);
|
||||||
|
$newName = '/' . sha1($view->file_get_contents('/files' . $path)) . '.odt';
|
||||||
|
|
||||||
$view->copy('/files' . $path, self::OFFICE_DIRNAME . $newName);
|
$view->copy('/files' . $path, self::OFFICE_DIRNAME . $newName);
|
||||||
\OC_FileProxy::$enabled = $proxyStatus;
|
\OC_FileProxy::$enabled = $proxyStatus;
|
||||||
return $newName;
|
return $newName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user