0

I am currently trying to update a media item programmatically. Methods like Create From File or Create From Stream are removing all the versions of the media item item and restarting from Version 1. I require to update only on the latest version.

1 Answer 1

0

Try using this.

var media = MediaManager.GetMedia(mediaItem);

media.SetStream(stream, "YourFileExtension");

This code will not delete any previous version and is useful if you want to modify the content of the media item.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.