Static Resources in Salesforce.com :- In our previous Salesforce developer tutorial we have clearly learned about different visualforce modular features. In this Salesforce Visualforce Tutorial we are going to learn about how to create static resources in Salesforce.com.

What is Static Resource in Salesforce.com ?

In salesforce.com, Static resources are those which are used to store images, files, documents, pdf document, archived, Zip files, style sheets, JavaScript files and so on. All these files are uploaded to static resources in salesforce.com to use in visualforce pages as a reference.

When images or file is uploaded to static resource we have to enter name where these names are validated when visualforce page is compiled. When visualforce page is compiled it prevents in creating invalid static resources. We can upload maximum size of  file to static resources is 5MB for single static resource. We have maximum for static resources in salesforce.com is 250MB only.

 How to upload files to Static Resources in Salesforce.com ?

To upload files or images to Static Resources in salesforce.com follow the steps given below.

Go to Develop=>Static Resources.

Creating Static Resources in Salesforce.com

Click on Static resources as shown above.

Creating Static Resources in Salesforce.com

Click on New button to create new Static resource in Salesforce.com.

Creating Static Resources in Salesforce.com

  • Enter the name for the static resource. The name must not contain spaces, alphanumeric characters, must be unique, name must begin with letter.
  • Description is optional.
  • Click on Choose file button to upload images, files, documents to resources.
  • Select cache control as private.

We have two option in cache control value in Static resources they are private and public.

If cache control is Public :- When creating static resources in Salesforce.com, Static resources data cached on saelsforce.com server will be shared to other user in our organization. It has no security and can be used by any user in an organization.

If cache control is Public :- If cache control is selected as private no Static Resource image are filed is shared with users in an organization. We have set cache control as private only.

How to use static resources in salesforce :- Get full details on Static resources.