I need to check Max Image Size and File Type so I can display the correct error in
ApexPages.Messages. I tried to do something like this:
if (conVer.FileType != '')
But I don't know what FileType values I can use.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You can use values like "WORD_X" or "PDF" or etc. The easiest way I've found is to upload a file, and then check the FileExtension field on ContentVersion or ContentDocument.
More details here: