Can not prevent uploading of specific files

Hi everyone!

I figured out how to prevent uploading of zip files using Files access control. I just wrote in Custom MIME type - /^application/(zip)$/i
But how to prevent uploading other types of files like rar, prt, sldprt and others?
If I’m trying to use /^application\/(rar)$/i or /^application\/(prt)$/i is does not work.

Am I doing something wrong?

UPD: i tried to ask ChatGPT and it said to try to change config.php so i added this:

    2 =>
    array (
      'sldprt' => 'application/sldprt',
      'prt' => 'application/prt',

it does not fixed my problem.

I wouldn’t make changes to your config.php because a silly chat bot said to…

Are you trying to block these files or just stop the client from syncing them? The client can exclude files based on name pattern. What you did above I think is for MIME types.

I’m trying to block specific file types using Files access control

As i said, it’s working only for zip files but i need to restrict other type of files .

Not tested.

The MIME type of a .zip file is application/zip.
The MIME type of a .rar file is application/x-rar-compressed.


Test for rar:



Test for prt:


Try the following:



if it still doesn’t work, try adding octet-stream as an additional MIME type, like this:


1 Like

I tested it, and the following one-liner works on my test instance, for both, rar and zip files:


beware of octet-stream it fits many binary formats - depending on what you are looking for this might affect more than you wanted…

1 Like

Thank you so much!

1 Like

So… how to find proper MIME type?

Use the command “file --mime-type <file>” to find out the mime type of a file.

where to type it?

On the Linux console or on your Windows PC if you’ve installed it.
See e.g. How can I find out a files “mime-type(Content-Type?)”? on Windows - Stack Overflow