---
schema_version: "1"
id: c857416e9bb19042f5830f1f28fa20ed64affa27ea4e28f74fc7a29a5c8eb183
title: StaticResource
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_staticresource.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_staticresource.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d4759b97777aabe546d640af5e7db8dc06ad2e60ab21af604cba71373c53f7e1
description: Represents a static resource file, often a code library in a ZIP file. 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.
---
# StaticResource

Represents a static resource file, often a code library in a ZIP file. 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.

This type extends the [MetadataWithContent](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_metadatawithcontent.htm "MetadataWithContent is the base type for all metadata types that contain content, such as documents or email templates. It extends Metadata. You can’t edit this object.") metadata type and inherits its content and fullName fields.

## File Suffix and Directory Location

The file suffix is .resource for the template file. The accompanying metadata file is named resource\-meta.xml.

Static resource components are stored in the staticresources folder in the corresponding package directory.

## Version

Static resources are available in API version 12.0 and later.

## Fields

This metadata type contains the following fields:

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d880092e115">Field Name</th>

              <th class="featureTableHeader  " id="d880092e118">Field Type</th>

              <th class="featureTableHeader  " id="d880092e121">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d880092e115" data-title="Field Name"><span class="keyword parmname">cacheControl</span></td>

              <td class="entry" headers="d880092e118" data-title="Field Type">StaticResourceCacheControl (<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_objects_intro.htm#enumeration_title">enumeration</a> of type string)</td>

              <td class="entry" headers="d880092e121" data-title="Description">Required. <span class="ph" id="field_cacheControl_desc"><a name="field_cacheControl_desc"><!-- --></a>Indicates whether the
                  static resource is marked with a public caching tag so that a
                  third-party delivery client can cache the content.</span> This
                field is available in API version 14.0. The valid values are:<ul class="ul bulletList">
                  <li class="li">Private</li>

                  <li class="li">Public</li>

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d880092e115" data-title="Field Name"><span class="keyword parmname">content</span></td>

              <td class="entry" headers="d880092e118" data-title="Field Type">base64Binary</td>

              <td class="entry" headers="d880092e121" data-title="Description">The static resource content. Base 64-encoded binary data. Before
                making an API call, client applications must encode the binary
                attachment data as base64. Upon receiving a response, client
                applications must decode the base64 data to binary. This conversion
                is handled for you by a SOAP client. This field is inherited from
                the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_metadatawithcontent.htm" title="MetadataWithContent is the base type for all metadata types that contain content, such as documents or email templates. It extends Metadata. You can’t edit this object.">MetadataWithContent</a> component.</td>

            </tr>

            <tr>
              <td class="entry" headers="d880092e115" data-title="Field Name"><span class="keyword parmname">contentType</span></td>

              <td class="entry" headers="d880092e118" data-title="Field Type">string</td>

              <td class="entry" headers="d880092e121" data-title="Description">Required. The content type of the file, for example
                text/plain.</td>

            </tr>

            <tr>
              <td class="entry" headers="d880092e115" data-title="Field Name"><span class="keyword parmname">description</span></td>

              <td class="entry" headers="d880092e118" data-title="Field Type">string</td>

              <td class="entry" headers="d880092e121" data-title="Description">The description of the static resource.</td>

            </tr>

            <tr>
              <td class="entry" headers="d880092e115" data-title="Field Name"><span class="keyword parmname">fullName</span></td>

              <td class="entry" headers="d880092e118" data-title="Field Type">string</td>

              <td class="entry" headers="d880092e121" data-title="Description">The static resource name. <span class="ph" id="fullName_allowed_chars"><a name="fullName_allowed_chars"><!-- --></a>The
                  name can only contain characters, letters, and the underscore
                  (_) character. The name must start with a letter, and can’t end
                  with an underscore or contain two consecutive underscore
                  characters.</span>
                <p class="p">Inherited from the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm" title="The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.">Metadata</a> component, this field isn’t defined in the WSDL for this
                  component. It must be specified when creating, updating, or
                  deleting. See <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_create.htm" title="Deprecated. Adds one or more new metadata components to your organization asynchronously. This call is removed as of API version 31.0 and is available in earlier versions only. Use createMetadata() instead.">create()</a> to see an example of this field
                  specified for a call.</p>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
    <contentType\>text/plain</contentType\>
    <description\>Test Resource</description\>
</StaticResource\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).