function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Simon234Simon234 

ContentVersion: how to check File Type and File Size?

I need to check Max Image Size and File Type for creating correct Error ApexPages.Messages. I try do something like this:
if (conVer.FileType != '')
But what can I write there?
Raj VakatiRaj Vakati

 


But You can do it as below 
 
Select Id ,ContentSize ,Description ,FileExtension,Title from ContentVersion

if (conVer.FileType != 'pdf' || conVer.ContentSize != 23407834)