🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
BlobStorage
This page was created by Hans.karlsen on 2017-03-29. Last edited by Wikiadmin on 2026-07-29.

You can keep large Blob, Text, and Image attribute values outside the granular model database when you build a MDriven Turnkey application by enabling external blob storage on the attribute.

What external blob storage does

External blob storage moves the file content for an attribute out of the granular model database. The out-of-the-box Turnkey implementation stores the content on the application server's file system.

Use this option when an attribute contains large file, text, or image data and you do not want that content stored in the granular model database.

This feature is available for MDriven Turnkey only.

Enable external storage for an attribute

In MDriven Designer, add the following tagged value to the Blob, Text, or Image attribute that should store its content externally:

ExternalBlobStorage = true

For example, a Document class can have a Blob attribute named FileContent. Add ExternalBlobStorage = true to Document.FileContent to store that attribute's content outside the granular model database.

Attribute example Tagged value Result
Document.FileContent (Blob) ExternalBlobStorage = true The file content is stored externally by Turnkey.
Photo.ImageData (Image) ExternalBlobStorage = true The image content is stored externally by Turnkey.
Report.Content (Text) ExternalBlobStorage = true The text content is stored externally by Turnkey.

Default file location and name

With the simplest out-of-the-box Turnkey setup, files are stored on disk under:

App_Data/BlobStorage

Turnkey names each stored file using this pattern:

Class.Attribute.Guid.blob

For example, content from Document.FileContent can be represented by a file name in the form:

Document.FileContent.<Guid>.blob

The GUID makes each stored file distinct.

Use the attribute in a Turnkey ViewModel

External storage changes where Turnkey keeps the attribute content. You still expose the attribute in a ViewModel to let users upload, download, or view it.

For example, add Document.FileContent to a ViewModel:

  • Make the column writable when users must upload or replace a file.
  • Use the documented download settings when users must download a file.
  • Configure an image attribute as an image when it should be displayed as an image.

For the ViewModel setup, file-name and content-type attributes, download links, and image-specific behavior, follow HowTos:Upload and Download Files and Images in MDriven Turnkey. For the BlobType attribute setting, see Documentation:Attribute.Eco.BlobType.

Cleanup is your responsibility

Turnkey does not automatically clean up files in external blob storage.

If a record is deleted, an attribute value is replaced, or stored content is no longer required, the corresponding file can remain in App_Data/BlobStorage. Plan and implement a cleanup process appropriate to your application so that unused files do not accumulate.

Consider before enabling

  • External blob storage is a Turnkey feature; do not rely on it for non-Turnkey clients.
  • The default out-of-the-box storage is on the application server's disk under App_Data/BlobStorage.
  • File lifecycle management is not automatic. Include storage monitoring and cleanup in the application's operational routines.
  • This setting concerns persistence location. Configure upload, download, and display behavior separately in the ViewModel.

See also