The TOM.NET API has quite a few AddBinary methods and overloads:
- RenderedItem.AddBinary (+ 7 overloads)
Other than the different method signatures is there any difference in behaviour between these?
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It only takes a minute to sign up.Sign up to join this community
Mihai Cădariu explains we should use the non-obsolete methods under:
The additional String in most of the method signatures lets you add a Variant ID to publish variations to different places. The string is saved in storage (broker) as explained in this SO answer. An example use case would be publishing a regular and small version of the same image (to different structure groups).
Some of those are deprecated. Note: the deprecated ones may not clean up added binaries when unpublishing.
Also if you want unpublishing of added binaries to work, you should specify the "relatedComponent" (as in one of the overloads) or the "componentUri"+"templateUri" (as in another overload). I believe for the overloads that only take a stream, filename and variantId will cause the binary to be unmanaged after publishing.