+ Start a Discussion

Input File Example



This is anji salesforce dEVELOPER........


Can u tell me the code for "Input File"     ..............


How to insert image into Registration form using InputFile ................?


Please send me the code ..................


thanking  you,




It sounds like you are looking for the apex:inputFile component - this allows you to upload files as attachments to records etc.


There's an example of using this in one of my blog posts at:



Jamie BrowningJamie Browning

Hi Bob,

I would like to bring your attention to this StackExchange Question.

It is regarding preventing Large Files attempting to upload to Salesforce via Visualforce

Do you have a simple tweak that might answer this quickly.

Code snippets included

Jamie BrowningJamie Browning

Hi Bob,

Checking your blog out, this one refers to attachments rather than files:

I will see if this helps me.

Jamie BrowningJamie Browning

Pre Checking File Size


Here is the additional JS:

var input, file;
input = document.getElementById('page:form:fileinput');
file = input.files[0];
var size = file.size;
document.getElementById('page:form:size').value = size;