Is there a filename regex to allow/reject upload based on characters in filename?

Any way to reject an upload based on a filename pattern match? I’d rather not accept uploads with spaces (0x16) in them as well as a few others.

FileAccessControl can only exclude certain mime types:

You could make a feature request for such an option in file-access-control, that would probably be the best implementation:

It probably also possible to hack such a filter somewhere in the server code but I’m not enough in the code to point you in the right direction. It’s very hacky, could break other things and must be put in place after each update.

well… after many months and no luck, I finally just patched it myself for NC 12. Yeah, hacky, but in the end I can have the functionality that I think is important. Glad this is a FOSS project. Patch below if anyone else wants it.

# diff -Naur  nextcloud/apps/files/js/files.js  file_filter/nextcloud/apps/files/js/files.js
--- nextcloud/apps/files/js/files.js	2017-10-04 12:17:31.446862756 -0500
+++ file_filter/nextcloud/apps/files/js/files.js	2017-10-04 12:18:30.820325469 -0500
@@ -96,7 +96,8 @@
 		isFileNameValid: function (name) {
 			var trimmedName = name.trim();
-			if (trimmedName === '.'	|| trimmedName === '..')
+         var validRE = new RegExp(/[^0-9a-z_\.]/gi);
+         if (trimmedName === '.' || trimmedName === '..' || validRE.test(trimmedName))
 				throw t('files', '"{name}" is an invalid file name.', {name: name});
 			} else if (trimmedName.length === 0) {