Check if the versioned file exists before trying to do the versioning
This didn't work with chunked uploading
This commit is contained in:
parent
ce10e1c19a
commit
b04c7175dc
|
@ -77,6 +77,7 @@ class Storage {
|
||||||
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory') . $this->view->getAbsolutePath('');
|
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory') . $this->view->getAbsolutePath('');
|
||||||
|
|
||||||
//check if source file already exist as version to avoid recursions.
|
//check if source file already exist as version to avoid recursions.
|
||||||
|
// todo does this check work?
|
||||||
if ($users_view->file_exists($filename)) {
|
if ($users_view->file_exists($filename)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -96,6 +97,11 @@ class Storage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we should have a source file to work with
|
||||||
|
if (!$files_view->file_exists($filename)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// check filesize
|
// check filesize
|
||||||
if($files_view->filesize($filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)) {
|
if($files_view->filesize($filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue