diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-02-16 12:39:44 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-02-17 15:38:21 +0100 |
commit | ceaefc2c54f4a5d4528bf2e7ba4607297d2453f4 (patch) | |
tree | 65d487575178af524633f0fe8a469848a1c11f7f /apps/files/ajax | |
parent | 8f96ef147f7ddf517e83e10b2dab5f4e94da9f06 (diff) | |
download | nextcloud-server-ceaefc2c54f4a5d4528bf2e7ba4607297d2453f4.tar.gz nextcloud-server-ceaefc2c54f4a5d4528bf2e7ba4607297d2453f4.zip |
Defer quota check in web UI when overwriting shared file
When receiving a shared file, the quota for that file counts in the
owner's storage, not the current user's storage.
To make it possible to overwrite the file even when the current user
doesn't have enough space, the quota check is deferred for such files.
Diffstat (limited to 'apps/files/ajax')
-rw-r--r-- | apps/files/ajax/upload.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 5bf69d3e304..36aaed5ad9e 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -136,8 +136,12 @@ $maxUploadFileSize = $storageStats['uploadMaxFilesize']; $maxHumanFileSize = OCP\Util::humanFileSize($maxUploadFileSize); $totalSize = 0; -foreach ($files['size'] as $size) { - $totalSize += $size; +$isReceivedShare = \OC::$server->getRequest()->getParam('isReceivedShare', false) === 'true'; +// defer quota check for received shares +if (!$isReceivedShare) { + foreach ($files['size'] as $size) { + $totalSize += $size; + } } if ($maxUploadFileSize >= 0 and $totalSize > $maxUploadFileSize) { OCP\JSON::error(array('data' => array('message' => $l->t('Not enough storage available'), |