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
ContentType
Returns the content type of the blob based on the known file extension.
public string ContentType { get; }
Property Value
Description
Returns the description a given by the user when uploading a file.
public string Description { get; }
Property Value
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
FileExtension
Returns the file extension of the file. This property can only be set using the SetBlob method.
public string FileExtension { get; }
Property Value
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
Size
Returns the size of the blob in bytes.
public int Size { get; }
Property Value
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
UserID
Returns the user ID of the user that set the blob.
public string UserID { get; }
Property Value
UserName
Returns the name of the user that set the blob.
public string UserName { get; }
Property Value
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
stringThe BlobData is the binary data of the blob as put in a string.
pFileName
stringThe file name of the uploaded file including the file extension, like 'MyImage.png'
pContentType
stringThis Optional parameter can contain the content type as is uploaded. Is stored but not actually used.
pDescription
stringThe 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
DateTimeAn UploadDateTime can be specified if wanted. If not specified, it the current UTC date time will be used.