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
Farhad KeywanFarhad Keywan 

Problem in reading file from system

Hi,

 

I want to build an automatic File upload functionality in Salesforce.File will be stored in some directory in my local system. Salesforce code should read that File and process accordingly.

 

Is this possible in Salesforce ? Please help.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

You can't arbitrarily read data from a local computer. You have to have some sort of server to retrieve from, and then you'd need to use HttpRequest/HttpResponse classes.

All Answers

sfdcfoxsfdcfox

You can do this. Take a look at apex:inputFile for details.

Farhad KeywanFarhad Keywan

Hi sfdcfox, 

My requirement is to read the file automatically without any manual work. However with the inputFile tag, I can see there is a browse button which appears close to an input text box and one has to browse the file to populate the text box with the path. 

 

I just need that the apex code should read the file automatically from the given path address. In other words, I need to schedule an apex program to read the file stored at a location in the system.

 

Thanks,

sfdcfoxsfdcfox

You can't arbitrarily read data from a local computer. You have to have some sort of server to retrieve from, and then you'd need to use HttpRequest/HttpResponse classes.

This was selected as the best answer