Skip to content

File

Extends

  • File

Properties

payload

payload: File;

The underlying payload data for this resource

Inherited from

Bkper.File.payload

Methods

create()

create(): File;

Perform create new File.

Returns

File

Inherited from

Bkper.File.create

deleteProperty()

deleteProperty(key): this;

Deletes a custom property.

Parameters

ParameterType
keystring

Returns

this

This resource, for chaining

Inherited from

Bkper.File.deleteProperty

getBlob()

getBlob(): Blob;

Gets the Blob from this file

Returns

Blob

Inherited from

Bkper.File.getBlob

getContent()

getContent(): string;

Gets the file content Base64 encoded

Returns

string

Inherited from

Bkper.File.getContent

getContentType()

getContentType(): string;

Gets the File content type

Returns

string

Inherited from

Bkper.File.getContentType

getId()

getId(): string;

Gets the File id

Returns

string

Inherited from

Bkper.File.getId

getName()

getName(): string;

Gets the File name

Returns

string

Inherited from

Bkper.File.getName

getProperties()

getProperties(): object;

Gets the custom properties stored in this resource.

Returns

object

Object with key/value pair properties

Inherited from

Bkper.File.getProperties

getProperty()

getProperty(...keys): string;

Gets the property value for given keys. First property found will be retrieved.

Parameters

ParameterType
keysstring[]

Returns

string

The property value or null if not found

Inherited from

Bkper.File.getProperty

getPropertyKeys()

getPropertyKeys(): string[];

Gets the custom properties keys stored in this resource.

Returns

string[]

Array of property keys sorted alphabetically

Inherited from

Bkper.File.getPropertyKeys

getSize()

getSize(): number;

Gets the file size in bytes

Returns

number

Inherited from

Bkper.File.getSize

getUrl()

getUrl(): string;

Gets the file serving url for accessing via browser

Returns

string

Inherited from

Bkper.File.getUrl

getVisibleProperties()

getVisibleProperties(): object;

Gets the visible custom properties stored in this resource. Hidden properties (those ending with ”_”) are excluded from the result.

Returns

object

Object with key/value pair properties, excluding hidden properties

Inherited from

Bkper.File.getVisibleProperties

json()

json(): File;

Gets an immutable copy of the JSON payload for this resource.

Returns

File

An immutable copy of the json payload

Inherited from

Bkper.File.json

setBlob()

setBlob(blob): File;

Sets the File properties from a Blob

Parameters

ParameterType
blobBlob

Returns

File

This File, for chainning.

Inherited from

Bkper.File.setBlob

setContent()

setContent(content): File;

Sets the File content Base64 encoded.

Parameters

ParameterType
contentstring

Returns

File

This File, for chainning.

Inherited from

Bkper.File.setContent

setContentType()

setContentType(contentType): File;

Sets the File content type.

Parameters

ParameterType
contentTypestring

Returns

File

This File, for chainning.

Inherited from

Bkper.File.setContentType

setName()

setName(name): File;

Sets the name of the File.

Parameters

ParameterType
namestring

Returns

File

This File, for chainning.

Inherited from

Bkper.File.setName

setProperties()

setProperties(properties): this;

Sets the custom properties of this resource.

Parameters

ParameterType
properties{ [key: string]: string; }

Returns

this

This resource, for chaining

Inherited from

Bkper.File.setProperties

setProperty()

setProperty(key, value): this;

Sets a custom property in this resource.

Parameters

ParameterType
keystring
valuestring

Returns

this

This resource, for chaining

Inherited from

Bkper.File.setProperty

setVisibleProperties()

setVisibleProperties(properties): this;

Sets the custom properties of this resource, filtering out hidden properties. Hidden properties are those whose keys end with an underscore ”_”.

Parameters

ParameterType
properties{ [key: string]: string; }

Returns

this

This resource, for chaining

Inherited from

Bkper.File.setVisibleProperties

setVisibleProperty()

setVisibleProperty(key, value): this;

Sets a custom property in this resource, filtering out hidden properties. Hidden properties are those whose keys end with an underscore ”_”.

Parameters

ParameterType
keystring
valuestring | null

Returns

this

This resource, for chaining

Inherited from

Bkper.File.setVisibleProperty