Public Upload - File Access Control

I like to provide a secure public upload location where only pdf files are allowed. When I define mime type is not application/pdf as only rule, I can not open the page for the public upload.

Otherwise when I define mime type is application/pdf I can reach the site but can not upload pdf files.


Nextcloud version (eg, 10.0.2): Nextcloud 12 Beta 4
Operating system and version (eg, Ubuntu 16.04): Cent OS 7
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.6
PHP version (eg, 5.6): PHP 5.6
Is this the first time you’ve seen this error?: Yes

Can you reliably replicate it? (If so, please outline steps):

  • define file access control rule: Mimetype IS NOT application/pdf
  • Share a folder - Public Upload (upload only)
  • go to the link of the shared folder
  • Upload page not found message

The issue you are facing:

  • want to see upload page where I only can upload pdf files

The output of your Nextcloud log in Admin > Logging:

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

The output of your Apache/nginx/system log in /var/log/____:


Remember, this information may be requested if it isn’t supplied; for fastest response please provide as much as you can :heart: Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

Hi,

I would suggest to have the following rule set:
Mimetype – IS NOT – application/pdf
Mimetype – IS NOT – httpd/unix-directory
Tag – IS – PDF-only

In Workflow you should create the Tag “PDF-only” and add that tag to the publicly shared folder.

Hope that helps.

1 Like

Man you are my hero. Works like it should :thumbsup:

This should be listed in the file access control wiki. I think this is one of the most powerful features you could handle with file access control.

Thanks a lot!

2 Likes