Skip to main content

I have an org that is setup with a Google Drive integration using File Connect and I am trying to read the contents of these files in Apex.

I'm able to view basic metadata about the file (name & size) but the file's content is returning null

file = ConnectApi.ContentHub.getRepositoryFile('myRepoID', 'myFileID');

System.debug(file.name); //Works

System.debug(String.valueOf(file.contentSize)); //Works

System.debug(file.contentBody); //Returns null

 

Salesforce docs for the contentBody field says it will return...

"Text of the file’s content if available, otherwise null."

 

So I guess I'm wondering what makes the file's content available? I'm able to view the files content in the Salesforce Files tab but I'd like to get access to it in Apex.

6 件の回答
0/9000