---
schema_version: "1"
id: 02ffd3bed106cfc0067b39e97a500ee6b764f75e0acaa684ac520c1c56e34acb
title: Using Static Resources
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/resources/pages-resources.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-resources.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e3db62716b71de813e5f82c5c895435cb48a7c92e3e1991a5f00bc47c99274af
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Using Static Resources

Static resources allow you to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files), images, style sheets, JavaScript, and other files. Static resources can be used only within your Salesforce org, so you can’t host content here for other apps or websites.

Using a static resource is preferable to uploading a file to the Documents tab because:

-   You can package a collection of related files into a directory hierarchy and upload that hierarchy as a .zip or .jar archive.
-   You can reference a static resource by name in page markup by using the `$Resource` global variable instead of hard coding document IDs.

**tip:** In addition, using static resources to refer to JavaScript or cascading style sheets (CSS) is preferable to including the markup inline. Managing this kind of content using static resources allows you to have a consistent look and feel for all your pages and a shared set of JavaScript functionality.

A single static resource can be up to 5 MB, and an organization can have up to 250 MB of static resources, total.

-   **[Creating a Static Resource](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-resources-create.md)**  


    You can use static resources to upload content that you can reference in a Visualforce page, including archives (such as .zip and .jar files), images, style sheets, JavaScript, and other files. You can use static resources only within your org, so you can’t host content here for other apps or websites.

-   **[Referencing a Static Resource in Visualforce Markup](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-resources-reference.md)**  

-   **[Referencing Untrusted Third-Party Content with iframes](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-resources-iframe.md)**  


