# new BlobStoreCustom (storeConfigObject, appInstanceServerApp, sessionInstanceUBSession)

Arguments:

Members

# App : ServerApp instance

# blacklistExtensionsSet : Set.<string> instance

Set of prohibited extensions (Example: '.jpg', '.png')

# config instance

Store parameters as defined in ubConfig

# historyDepth : number instance

How many previous revision is stored

# name instance

Name of store (from app config)

# Session : UBSession instance

# tempFolder : string instance

Path to temp folder

# whileListExtensionSet : Set.<string> instance

Set of allowed extensions (Example: '.jpg', '.png'). If null - any extension is allowed.

Methods

# validateFileName (fnstring) static

validate file name contains only alphanumeric characters, -, _, . and space and not contains ..

Arguments:

# doArchive (attributeUBEntityAttribute, IDnumber, blobInfoBlobStoreItem) → BlobStoreItem instance

Do something with BLOB content during archiving. For example - move to slow drive etc. Default implementation do nothing.

Arguments:

# doDeletion (attributeUBEntityAttribute, IDnumber, blobInfoBlobStoreItem) instance

Delete persisted BLOB content

Arguments:

# extensionAllowed (extstring) → boolean instance

Check file extension allowed by store whileList and not prohibited dy store blackList

Arguments:

# fillResponse (requestParamsBlobStoreRequest, blobInfoBlobStoreItem, reqTHTTPRequest, respTHTTPResponse, preventChangeRespOnErroroptboolean) → boolean instance

Fill HTTP response for getDocument request. Sets resp to 404 status if content not found.

Arguments:

# getContent (requestBlobStoreRequest, blobInfoBlobStoreItem, optionsoptobject) → string | UBMail.TubSendMailAttachKind.Buffer | ArrayBuffer | null instance

Retrieve BLOB content from blob store.

Arguments:

# getContentFilePath (requestBlobStoreRequest, blobInfoBlobStoreItem) → string instance

Returns full path to the file with BLOB content

Arguments:

# getMimeType (fileNameOrExtstring, isExtensionoptboolean) → string instance

Get mime type for passed file name or file extension. Recognize well known extensions missed in mime-db@1.52

Arguments:
  • fileNameOrExt: string
  • isExtension = false: boolean

    is first parameter a file extension (.pdf for example)

# getTempFileName (requestBlobStoreRequest) → string instance

Get path to temporary file and it's name

Arguments:

# persist (attributeUBEntityAttribute, IDnumber, dirtyItemBlobStoreItem, newRevisionnumber) → BlobStoreItem | null instance

Move content defined by dirtyItem from temporary to permanent store. Return a new attribute content which describe a place of BLOB in permanent store

Arguments:

# saveContentToTempStore (requestBlobStoreRequest, attributeUBEntityAttribute, contentArrayBuffer) → BlobStoreItem instance

Implementation must save file content to temporary store

Arguments: