There's no copy method on the MediaService - how would I go about creating a copy of an existing media item, given the id of the parent of the new item?
i think you should create a new mediaitem with the CreateMedia method. If you load the item you would like to copy, you can use those properties to create the new item. Ex. parentId.
Will that actually create a copy of the media asset (ie the image or file)? I need the copy to have its own file, not just the same URL as the original, if that makes sense?
MediaService - copy?
There's no copy method on the MediaService - how would I go about creating a copy of an existing media item, given the id of the parent of the new item?
Hi Nathan,
i think you should create a new mediaitem with the
CreateMedia
method. If you load the item you would like to copy, you can use those properties to create the new item. Ex. parentId.https://our.umbraco.org/documentation/Reference/Management-v6/Services/MediaService
Best regards René
Hi Rene
Will that actually create a copy of the media asset (ie the image or file)? I need the copy to have its own file, not just the same URL as the original, if that makes sense?
Hi Nathan,
no it will not. I think you will have to use System.IO to do the copy (http://www.dotnetperls.com/file-copy).
/René
is working on a reply...