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
ravindraravindra 

What are all the file formats that I can read and write though Apex/Visualforce?

Hi,

 

    I just want to know what are the file format's I can read and write through my Apex/Visual force code.

 

 

Thanks in Advance

ravi

Best Answer chosen by Admin (Salesforce Developers) 
jrotensteinjrotenstein
Mmm, unlikely. I found a couple of objects called Document and DocumentAttachmentMap that will likely give you access to metadata on the document stored in Salesforce, but there are no Apex functions to access the actual document content.

All Answers

jrotensteinjrotenstein

You cannot read/write files via Apex. It operates wholly on the Salesforce platform with no access to a file system. However, you import CSV files into an object (either manually through the UI, or via Data Loader) and then use Apex code to process the data in those objects.

Visualforce is capable of outputting a page as a PDF file.

You can also use the Salesforce API to 'push' data into Salesforce, and Apex can call external web services to 'pull' data into Salesforce.

ravindraravindra

Thanks for the reply.

 

Is it that if i store an excel file as a static resource inside salesforce platform can i read the file through my Apex code?

 

 

jrotensteinjrotenstein
Mmm, unlikely. I found a couple of objects called Document and DocumentAttachmentMap that will likely give you access to metadata on the document stored in Salesforce, but there are no Apex functions to access the actual document content.
This was selected as the best answer