public with sharing class FilePreviewDownVFController { public String staticResource {get; set;} public String fileKey {get; set;} public String fileName {get; set;} public String type {get; set;} public String url {get; set;} public string body{get;set;} public FilePreviewDownVFController(ApexPages.StandardController controller) { // staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Document')); Pagereference pf = ApexPages.currentPage(); if(pf != null){ fileKey = pf.getParameters().get('key'); fileName = pf.getParameters().get('name'); type = pf.getParameters().get('type'); url = pf.getParameters().get('url'); } List contentList = [select Id, VersionData from ContentVersion where Id = '068C50000000nrxIAA']; body = EncodingUtil.base64Encode(contentList[0].VersionData); System.debug(body); } }