File access controll -> cannot create new folders!

Hello,

i created this access rule (do not wonder, because our Users only can upload this Mime-Types)

This rule works fine for us, but Users cannot create new folders.
The Message is “Could not create [Foldername]”.

So I add this rule:
“File mime type” “is not” “inode/directory”

But this doesn’t work. User become the same Error-Message.

What’s the Problem ?

Regards
Alex.

This is what I had to learn as well. File Access Control doesn’t support all mime types that exist but only these ones:

"3gp": ["video/3gpp"],
"7z": ["application/x-7z-compressed"],
"accdb": ["application/msaccess"],
"ai": ["application/illustrator"],
"apk": ["application/vnd.android.package-archive"],
"arw": ["image/x-dcraw"],
"avi": ["video/x-msvideo"],
"bash": ["text/x-shellscript"],
"bat": ["application/x-msdos-program"],
"blend": ["application/x-blender"],
"bin": ["application/x-bin"],
"bmp": ["image/bmp"],
"bpg": ["image/bpg"],
"bz2": ["application/x-bzip2"],
"cb7": ["application/x-cbr"],
"cba": ["application/x-cbr"],
"cbr": ["application/x-cbr"],
"cbt": ["application/x-cbr"],
"cbtc": ["application/x-cbr"],
"cbz": ["application/x-cbr"],
"cc": ["text/x-c"],
"cdr": ["application/coreldraw"],
"class": ["application/java"],
"cmd": ["application/cmd"],
"cnf": ["text/plain"],
"conf": ["text/plain"],
"cpp": ["text/x-c++src"],
"cr2": ["image/x-dcraw"],
"css": ["text/css"],
"csv": ["text/csv"],
"cvbdl": ["application/x-cbr"],
"c": ["text/x-c"],
"c++": ["text/x-c++src"],
"dcr": ["image/x-dcraw"],
"deb": ["application/x-deb"],
"dng": ["image/x-dcraw"],
"doc": ["application/msword"],
"docm": ["application/vnd.ms-word.document.macroEnabled.12"],
"docx": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],
"dot": ["application/msword"],
"dotx": ["application/vnd.openxmlformats-officedocument.wordprocessingml.template"],
"dv": ["video/dv"],
"eot": ["application/vnd.ms-fontobject"],
"epub": ["application/epub+zip"],
"eps": ["application/postscript"],
"erf": ["image/x-dcraw"],
"exe": ["application/x-ms-dos-executable"],
"fb2": ["application/x-fictionbook+xml", "text/plain"],
"flac": ["audio/flac"],
"flv": ["video/x-flv"],
"gif": ["image/gif"],
"gz": ["application/x-gzip"],
"gzip": ["application/x-gzip"],
"h": ["text/x-h"],
"hh": ["text/x-h"],
"hpp": ["text/x-h"],
"htaccess": ["text/plain"],
"html": ["text/html", "text/plain"],
"htm": ["text/html", "text/plain"],
"ical": ["text/calendar"],
"ics": ["text/calendar"],
"iiq": ["image/x-dcraw"],
"impress": ["text/impress"],
"java": ["text/x-java-source"],
"jpeg": ["image/jpeg"],
"jpg": ["image/jpeg"],
"jps": ["image/jpeg"],
"js": ["application/javascript", "text/plain"],
"json": ["application/json", "text/plain"],
"k25": ["image/x-dcraw"],
"kdc": ["image/x-dcraw"],
"key": ["application/x-iwork-keynote-sffkey"],
"keynote": ["application/x-iwork-keynote-sffkey"],
"kra": ["application/x-krita"],
"ldif": ["text/x-ldif"],
"lwp": ["application/vnd.lotus-wordpro"],
"m2t": ["video/mp2t"],
"m4a": ["audio/mp4"],
"m4b": ["audio/m4b"],
"m4v": ["video/mp4"],
"markdown": ["text/markdown"],
"mdown": ["text/markdown"],
"md": ["text/markdown"],
"mdb": ["application/msaccess"],
"mdwn": ["text/markdown"],
"mkd": ["text/markdown"],
"mef": ["image/x-dcraw"],
"mkv": ["video/x-matroska"],
"mobi": ["application/x-mobipocket-ebook"],
"mov": ["video/quicktime"],
"mp3": ["audio/mpeg"],
"mp4": ["video/mp4"],
"mpeg": ["video/mpeg"],
"mpg": ["video/mpeg"],
"mpo": ["image/jpeg"],
"msi": ["application/x-msi"],
"mts": ["video/MP2T"],
"mt2s": ["video/MP2T"],
"nef": ["image/x-dcraw"],
"numbers": ["application/x-iwork-numbers-sffnumbers"],
"odf": ["application/vnd.oasis.opendocument.formula"],
"odg": ["application/vnd.oasis.opendocument.graphics"],
"odp": ["application/vnd.oasis.opendocument.presentation"],
"ods": ["application/vnd.oasis.opendocument.spreadsheet"],
"odt": ["application/vnd.oasis.opendocument.text"],
"oga": ["audio/ogg"],
"ogg": ["audio/ogg"],
"ogv": ["video/ogg"],
"one": ["application/msonenote"],
"opus": ["audio/ogg"],	
"orf": ["image/x-dcraw"],
"otf": ["application/font-sfnt"],
"pages": ["application/x-iwork-pages-sffpages"],
"pdf": ["application/pdf"],
"pfb": ["application/x-font"],
"pef": ["image/x-dcraw"],
"php": ["application/x-php"],
"pl": ["application/x-perl"],
"png": ["image/png"],
"pot": ["application/vnd.ms-powerpoint"],
"potm": ["application/vnd.ms-powerpoint.template.macroEnabled.12"],
"potx": ["application/vnd.openxmlformats-officedocument.presentationml.template"],
"ppa": ["application/vnd.ms-powerpoint"],
"ppam": ["application/vnd.ms-powerpoint.addin.macroEnabled.12"],
"pps": ["application/vnd.ms-powerpoint"],
"ppsm": ["application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],
"ppsx": ["application/vnd.openxmlformats-officedocument.presentationml.slideshow"],
"ppt": ["application/vnd.ms-powerpoint"],
"pptm": ["application/vnd.ms-powerpoint.presentation.macroEnabled.12"],
"pptx": ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
"ps": ["application/postscript"],
"psd": ["application/x-photoshop"],
"py": ["text/x-python"],
"raf": ["image/x-dcraw"],
"rar": ["application/x-rar-compressed"],
"reveal": ["text/reveal"],
"rss": ["application/rss+xml"],
"rtf": ["text/rtf"],
"rw2": ["image/x-dcraw"],
"schema": ["text/plain"],
"sgf": ["application/sgf"],
"sh-lib": ["text/x-shellscript"],
"sh": ["text/x-shellscript"],
"srf": ["image/x-dcraw"],
"sr2": ["image/x-dcraw"],
"svg": ["image/svg+xml", "text/plain"],
"swf": ["application/x-shockwave-flash", "application/octet-stream"],
"tar": ["application/x-tar"],
"tar.bz2": ["application/x-bzip2"],
"tar.gz": ["application/x-compressed"],
"tbz2": ["application/x-bzip2"],
"tex": ["application/x-tex"],
"tgz": ["application/x-compressed"],
"tiff": ["image/tiff"],
"tif": ["image/tiff"],
"ttf": ["application/font-sfnt"],
"txt": ["text/plain"],
"vcard": ["text/vcard"],
"vcf": ["text/vcard"],
"vob": ["video/dvd"],
"vsd": ["application/vnd.visio"],
"wav": ["audio/wav"],
"webm": ["video/webm"],
"woff": ["application/font-woff"],
"wpd": ["application/vnd.wordperfect"],
"wmv": ["video/x-ms-wmv"],
"xcf": ["application/x-gimp"],
"xla": ["application/vnd.ms-excel"],
"xlam": ["application/vnd.ms-excel.addin.macroEnabled.12"],
"xls": ["application/vnd.ms-excel"],
"xlsb": ["application/vnd.ms-excel.sheet.binary.macroEnabled.12"],
"xlsm": ["application/vnd.ms-excel.sheet.macroEnabled.12"],
"xlsx": ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
"xlt": ["application/vnd.ms-excel"],
"xltm": ["application/vnd.ms-excel.template.macroEnabled.12"],
"xltx": ["application/vnd.openxmlformats-officedocument.spreadsheetml.template"],
"xml": ["application/xml", "text/plain"],
"xrf": ["image/x-dcraw"],
"yaml": ["application/yaml", "text/plain"],
"yml": ["application/yaml", "text/plain"],
"zip": ["application/zip"]

I couldn’t discover a mime type for directories here. I guess we have to open a feature request for that.

httpd/unix-directory is what you are looking for

Good morning,
if i attempt “httpd/unix-directory” to the rule we become this error message

Any idea ?

Hi,

By having a rule for directories you forbid access to folders, I’d say.

So what you could do is adding a tag to that specific folder (where only photo uploads are allowed) and add this tag to the rule set as well.

Tag: photo-restricted

Rule:
mimetype folder
tag photo-restricted

Then your rule set only applies to the folders tagged like that.
Just an idea.

Hi Schmu,

nickvergessenSer has helped me. Look here:

But now I have a new problem:
I shared a folder by link with “Allow upload and editing”.
The Recipient of the Link can not upload Files into the share.
Error Message “Forbidden”. If i disable the App everything is ok.

Hi @tux73,

Can you provide some more information please? What are the tags for the folder, what are the current rule sets in File Access Control and what kind of files was the other person trying to upload?
What does the log files of nextcloud say?

Hi Schmu,

I shared a folder by Link with this permissions:

Tags for this folder ? I doesn’t find “Tags” in Detail View ?!

Here my actual rules:

The User try to upload *.jpg to this folder and the Error message is “Forbidden”.
Log says:

Hi,

I think there is a bug in the File Access Control App.
For testing I created a folder and the rules you have. Afterwards I wanted to share this test folder via link and also with another NC user. Both didn’t work and I received the error message, that I’m not allowed to change the folder permissions.
What I had to do then, was to create a new Tag, add that Tag to the rule set and then share the folder. First after I shared the folder I added the Tag.

In return I had to remove the Tag to be able to “un-share” the folder.

However uploading PNG- und JPG- files only worked in combination with the tag.

You can add Tags, when you select the folder details:

For some reason this “Tags” link vanishes as soon as the folder is shared - no matter if internally shared or with a link to external. You can only get this link “Tags” back, if you close the details view and re-open it. Seems to be a bug as well.

I hope this helps.

Hi,

funny i do not have the “Tags” Symbol. Any idea why ?

Can you send me a screenshot from your rules ?

Regards
Alex.

Oh, then I guess you deactivated the app “Collaborative tags”. This is an official app and I think it was activated by default on my system.

This App makes me crazy :frowning:
I have done this as you described but it doesn’t work.
After this i deleted the tag an also the rule and test again.
Then i shared the folder with a Nextcloud User.
Strangely now the NC-User can upload Files.
External User not !