I'm trying to make a trigger that prevents the user from uploading a file that is larger than 100mb. I'm doing this by checking the file size in the ContentVersion trigger and using addError.

However, when the error appears on the front end, it just contains the default error message, "Can't upload myfile.zip". I can't get it to show a different error message. (I also tried throwing an exception instead of using addError, but the result is the same.)

Does anyone happen to know if it's possible to change the error message in this situation? Or will any error related to file uploading always result in this default error message?

Here is a screenshot of the error message I'm talking about: enter image description here

1 Answer 1


Unfortunately I also couldn't find a way to this by addError or exception message, so I had to write entire thingy custom and include it in the layout, see the idea here and worth voting for it: https://success.salesforce.com/ideaView?id=0873A000000lItzQAE

  • 1
    Would you mind briefly describing the solution you ended up going with? For example did you make a Lightning component that listens for a platform event?
    – Ian Horner
    Commented Nov 27, 2019 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .