Try our conversational search powered by Generative AI!

Attachments: Bytes, Blobs, ?

Ed
Ed
Vote:
 

How are attachments saved in the datastore? We created some functionality where we will have users submit content with attachments. Are we saving attachments as blobs, bytes, something else? What data do I need to save attachments when I have a custom content type containing media files?

#229514
Oct 16, 2020 19:56
Vote:
 

Hi Ed

To save the attachment data to a blob, you will need some kind of content type that derives from MediaData. Then you can create a blob from your binary data and assign that blob to an instance of your content type.

Basically you will write data to a Stream and Episerver will store it in either blobs or files, depending on the hosting platform (e.g. a cloud site or a regular server).

Samples are provided on this documentation page.

#229538
Oct 17, 2020 16:31
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.