Table of Contents

Class Blob

Namespace
PolarStudio
Assembly
PolarStudio.dll

This class provides an easy interface to work with blobs in blob-fields. Blobs are files stored in either the database (in Image or Binary fields) or are stored in the file system while the meta-data is stored in the database in a Text or Varchar field.

public class Blob
Inheritance
Blob
Inherited Members
Extension Methods

Properties

BlobData

This property sets/gets the binary data stored in a string.

public string BlobData { get; set; }

Property Value

string

ContentType

Returns the content type of the blob based on the known file extension.

public string ContentType { get; }

Property Value

string

Description

Returns the description a given by the user when uploading a file.

public string Description { get; }

Property Value

string

EmailAttachmentData

This method returns the generic string as is to be used for Email attachments. It returns 'FileName + CrLf + BlobData'.

public string EmailAttachmentData { get; }

Property Value

string

FileExtension

Returns the file extension of the file. This property can only be set using the SetBlob method.

public string FileExtension { get; }

Property Value

string

FileName

Returns the file name including the file extension. The path of the file is not stored in the database. This property can only be set using the SetBlob method.

public string FileName { get; }

Property Value

string

Size

Returns the size of the blob in bytes.

public int Size { get; }

Property Value

int

UploadDateTime

Returns the UTC date/time the file was uploaded (unless another Date/Time was specified in the SetBlob command).

public DateTime UploadDateTime { get; }

Property Value

DateTime

UserID

Returns the user ID of the user that set the blob.

public string UserID { get; }

Property Value

string

UserName

Returns the name of the user that set the blob.

public string UserName { get; }

Property Value

string

Methods

Clear()

This method clears the blob and all meta data.

public void Clear()

SetBlob(string, string, string, string, DateTime)

This method is to be used to set a new blob.

public string SetBlob(string pBlobData, string pFileName, string pContentType = "", string pDescription = "", DateTime pUploadDateTime = default)

Parameters

pBlobData string

The BlobData is the binary data of the blob as put in a string.

pFileName string

The file name of the uploaded file including the file extension, like 'MyImage.png'

pContentType string

This Optional parameter can contain the content type as is uploaded. Is stored but not actually used.

pDescription string

The description as given by the user. Square brackets will be replaced by curly brackets and the length will be limited to the Engine.MaxStateTransitionNoteLength

pUploadDateTime DateTime

An UploadDateTime can be specified if wanted. If not specified, it the current UTC date time will be used.

Returns

string