We want to avoid, that a user is able to upload files to chatter comments. We realized this by creating triggers on FeedComment and ContentVersion. This prevents to save the comment successfully.
If a user selects a local file to upload, the file exists in the chatter files tab as content document record. The file exists, although our trigger works, which prevents saving file comments.
The same behaviour occurs, if a user click cancel after uploading the file while creating a comment.
A trigger on content document won't be called on upload. How can I prevent uploading chatter files?