Hello, everyone.
I’m using mime filtering for some file extensions to prevent users from uploading to cloud storage files that are not matching this filter. Mime filter stroke is:
/^application/(msexcel|msword|vnd.ms-excel|vnd.ms-powerpoint|vnd.openxmlformats-officedocument.wordprocessingml.document|vnd.openxmlformats-officedocument.spreadsheetml.sheet|vnd.openxmlformats-officedocument.presentationml.presentation|pdf|zip|x-zip-compressed|x-rar-compressed|x-7z-compressed)$|text/(plain|csv)$|image/(jpeg|heic|png)|httpd/unix-directory/I
This stroke covers doc,docx,xls,xlsx… and rar. everything is working, except rar extension…
even if I use only rar filter it will not work.
Every time I try to upload a file with rar extension I get this error in logs (see the spoiler).
Spoiler
OCA\DAV\Connector\Sabre\Exception\Forbidden: Access denied
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1104:
OCA\DAV\Connector\Sabre\Directory->createFile()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 527:
Sabre\DAV\Server->createFile()
/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
Sabre\DAV\CorePlugin->httpPut()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 474:
Sabre\DAV\Server->emit()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 251:
Sabre\DAV\Server->invokeMethod()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 319:
Sabre\DAV\Server->start()
/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php - line 113:
Sabre\DAV\Server->exec()
/var/www/html/nextcloud/public.php - line 81:
require_once(“/var/www/ht … p”)
Caused by OCP\Files\ForbiddenException: Access denied
/var/www/html/nextcloud/apps/files_accesscontrol/lib/StorageWrapper.php - line 59:
OCA\FilesAccessControl\Operation->checkFileAccess()
/var/www/html/nextcloud/apps/files_accesscontrol/lib/StorageWrapper.php - line 286:
OCA\FilesAccessControl\StorageWrapper->checkFileAccess()
/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 300:
OCA\FilesAccessControl\StorageWrapper->unlink()
/var/www/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 155:
OCA\DAV\Connector\Sabre\File->put()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1104:
OCA\DAV\Connector\Sabre\Directory->createFile()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 527:
Sabre\DAV\Server->createFile()
/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
Sabre\DAV\CorePlugin->httpPut()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 474:
Sabre\DAV\Server->emit()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 251:
Sabre\DAV\Server->invokeMethod()
/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 319:
Sabre\DAV\Server->start()
/var/www/html/nextcloud/apps/dav/appinfo/v1/publicwebdav.php - line 113:
Sabre\DAV\Server->exec()
/var/www/html/nextcloud/public.php - line 81:
require_once(“/var/www/ht … p”)