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
anjisalesforce@gmail.comanjisalesforce@gmail.com 

Input File Example

Hi,

 

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,

Anjireddy

 


bob_buzzardbob_buzzard

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:

 

http://bobbuzzard.blogspot.com/2011/01/uploading-multiple-attachments-via.html

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.
https://salesforce.stackexchange.com/q/294115/38277

Code snippets included

Jamie BrowningJamie Browning

Hi Bob,

Checking your blog out, this one refers to attachments rather than files:
http://bobbuzzard.blogspot.com/2014/09/check-file-size-on-upload-in-visualforce.html

I will see if this helps me.

Jamie BrowningJamie Browning

Pre Checking File Size

https://stackoverflow.com/questions/3717793/javascript-file-upload-size-validation

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;