I'm using the following code to generate ContentVersion.
String title = 'sample file.txt'; ContentVersion contentVersion = new ContentVersion( VersionData = Blob.valueOf(jsonBodyPretty), Title = title, ContentLocation = 'S', PathOnClient = title ); insert contentVersion;
But when I try to preview it from Salesforce 'No Preview is Available'. If I download file and re-upload - everything is ok.
Have someone was able to create Previews from Apex for ContentVersion?