Skip to main content
Version: 2.0.0

Interface: StorageConfig

Additional configuration related to Storage related fields

Properties​

acceptedFiles​

• Optional acceptedFiles: string[]

File MIME types that can be uploaded to this reference. Don't specify for all. Note that you can also use the asterisk notation, so image/* accepts any image file, and so on.

Defined in​

lib/src/types/properties.ts:704


fileName​

• Optional fileName: string | (context: UploadedFileContext) => string | Promise<string>

You can use this prop to customize the uploaded filename. You can use a function as a callback or a string where you specify some placeholders that get replaced with the corresponding values.

  • {file} - Full file name
  • {file.name} - Name of the file without extension
  • {file.ext} - Extension of the file
  • {rand} - Random value used to avoid name collisions
  • {entityId} - ID of the entity
  • {propertyKey} - ID of this property
  • {path} - Path of this entity

Param

Defined in​

lib/src/types/properties.ts:733


imageCompression​

• Optional imageCompression: ImageCompression

Use client side image compression and resizing Will only be applied to these MIME types: image/jpeg, image/png and image/webp

Defined in​

lib/src/types/properties.ts:710


maxSize​

• Optional maxSize: number

Define maximal file size in bytes

Defined in​

lib/src/types/properties.ts:765


metadata​

• Optional metadata: Record<string, unknown>

Specific metadata set in your uploaded file. For the default Firebase implementation, the values passed here are of type firebase.storage.UploadMetadata

Defined in​

lib/src/types/properties.ts:717


postProcess​

• Optional postProcess: (pathOrUrl: string) => Promise<string>

Type declaration​

â–¸ (pathOrUrl): Promise<string>

Postprocess the saved value (storage path or URL) after it has been resolved.

Parameters​
NameType
pathOrUrlstring
Returns​

Promise<string>

Defined in​

lib/src/types/properties.ts:771


storagePath​

• storagePath: string | (context: UploadedFileContext) => string

Absolute path in your bucket.

You can use a function as a callback or a string where you specify some placeholders that get replaced with the corresponding values.

  • {file} - Full file name
  • {file.name} - Name of the file without extension
  • {file.ext} - Extension of the file
  • {rand} - Random value used to avoid name collisions
  • {entityId} - ID of the entity
  • {propertyKey} - ID of this property
  • {path} - Path of this entity

Defined in​

lib/src/types/properties.ts:748


storeUrl​

• Optional storeUrl: boolean

When set to true, this flag indicates that the download URL of the file will be saved in the datasource, instead of the storage path.

Note that the generated URL may use a token that, if disabled, may make the URL unusable and lose the original reference to Cloud Storage, so it is not encouraged to use this flag.

Defaults to false.

Defined in​

lib/src/types/properties.ts:760

Enterprise or start-up?

Learn how to get the most out of your project with the help of our consulting team.
Learn more
Sign up to our newsletter to get the latest news and updates. No spam!