Sitecore.Resources.Media.MediaCreator 删除媒体版本
我使用“Sitecore.Resources.Media.MediaCreator”和“CreateFromStream”功能将图像添加到媒体库。 一切似乎都工作正常,除了每次我将新图像添加到现有图像项目时,旧图像都会被覆盖,我想创建一个新版本,并将新图像添加到新版本,保留旧版本和图像。图像应基于“无版本化”模板,因为图像在语言之间共享。
我尝试在添加新媒体之前以编程方式添加新版本,但在运行 CreateFromStream() 后新版本被删除。
我还尝试了不同的 MediaCreatorOptions“Versioned”和“KeepExisting”,但它对我没有帮助。
使用 SheerUI 可以做到这一点,所以我想这应该是可能的。
我真的很感激任何帮助。
I am adding images to the Media Library using the "Sitecore.Resources.Media.MediaCreator" and the "CreateFromStream"-function.
Everything seems to work fine except that everytime I add a new image to an already existing image item the old image is overwritten, I would like to create a new version instead and add the new image to the new version, keeping the old version and image. The images should be based on an "unversioned" template as images are shared between languages.
I have tried programmatically adding a new version prior to adding new media but the new version is deleted after running CreateFromStream().
I have also tried the different MediaCreatorOptions "Versioned" and "KeepExisting" but it doesn't help me.
It is possible to do this using SheerUI so I guess it should be possible.
I would really appreciate any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我解决了。
这段代码并没有删除任何以前的版本,当然我需要添加之前的新版本。
I think I solved it.
This code does not delete any previous versions, off course I need to add the new versions before.