+ 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)