React Native Firebase
    Preparing search index...

    Object metadata that can be set at upload.

    Use the exported types directly instead. FirebaseStorageTypes namespace is kept for backwards compatibility.

    interface UploadMetadata {
        cacheControl?: string;
        contentDisposition?: string;
        contentEncoding?: string;
        contentLanguage?: string;
        contentType?: string;
        customMetadata?: { [key: string]: string };
        md5Hash?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    cacheControl?: string

    The 'Cache-Control' HTTP header that will be set on the storage object when it's requested.

    To turn off caching, you can set the following cacheControl value.

    {
    cacheControl: 'no-store',
    }

    To aggressively cache an object, e.g. static assets, you can set the following cacheControl value.

    {
    cacheControl: 'public, max-age=31536000',
    }

    Learn more about this header on Mozilla.

    contentDisposition?: string

    The 'Content-Disposition' HTTP header that will be set on the storage object when it's requested.

    Learn more about this header on Mozilla.

    contentEncoding?: string

    The 'Content-Encoding' HTTP header that will be used on the storage object when it's requested.

    Learn more about this header on Mozilla.

    contentLanguage?: string

    The 'Content-Language' HTTP header that will be set on the storage object when it's requested.

    Learn more about this header on Mozilla.

    contentType?: string

    The 'Content-Type' HTTP header that will be set on the object when it's requested.

    This is used to indicate the media type (or MIME type) of the object. When uploading a file Firebase Cloud Storage for React Native will attempt to automatically detect this if contentType is not already set, if it fails to detect a media type it will default to application/octet-stream.

    For DATA_URL string formats uploaded via putString this will also be automatically extracted if available.

    Setting the content type as JSON, e.g. for when uploading a JSON string via putString.

    {
    contentType: 'application/json',
    }

    Learn more about this header on Mozilla.

    customMetadata?: { [key: string]: string }

    Additional user-defined custom metadata for this storage object.

    All values must be strings.

    Adding a user controlled NSFW meta data field.

    {
    customMetadata: {
    'nsfw': 'true'
    },
    md5Hash?: string

    A Base64-encoded MD5 hash of the object being uploaded.