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
krish99krish99 

upload a csv file by using visualforce

HI,

          i want to uplad a csv file into my custom object,, through visualforce page

 after upload is done i want display the csv file records in same visual force page only can any one suggest me how it is possible.

firechimpfirechimp

Hi Krish,

 

This should give you the information you need:

http://developer.force.com/cookbook/recipe/uploading-a-document-using-visualforce-and-a-custom-controller

 

In short, use:

<apex:inputFile value="{!document.body}" filename="{!document.name}" id="file"/>

 To select a file and get the data from it, then you can access this in your controller on the click of the upload button and do what you want with it (store as document, attachment or convert into records etc...).