Search code examples
c#kenticokentico-api

How to create Kentico media library file using file stream


I'm trying to use Kentico API (Kentico.Libraries 12.0.54) in a console app to create a media library file.

The example on docs site shows how to do this using a file on the file system. But in our case the file source will be a MemoryStream.

Is that possible using the out-of-the-box API or do I need to save the MemoryStream to a temp file on the file system before pushing it to Kentico CMS?


Solution

  • Might want to check out this similar question:

    Kentico - Pass MemoryStream file to MediaFileInfo API

    But it doesn't look like you can pass the MemoryStream directly to create the file.