1 Answer
1

Is the excel file managed in Tridion? If yes, then to have binaries deployed to a different folder than the default multimedia folder, you will need to use a method which takes a Structure Group as one of its parameters and the binary will end up in the corresponding file path.

If you can identify the specific component from within its template, then all you need to do is use the following method from within the CT, no need for an Event System:

RenderedItem.AddBinary(Component, StructureGroup)

The RenderedItem is available the following way engine.PublishingContext.RenderedItem

If you insist on an Event System, then from the top of my head, I would use the following approach.

Have a dedicated CT which uses the previously described mechanism for publishing the binary. You can even have everything hardcoded.

In a Publish Transaction Save event, check its state as In Progress and whether the specific Component is being published. Do note that the challenge here is identifying whether that component is published indirectly, which can happen.

After detecting that the specific component is being published, publish the dedicated CT from within the ES code, which will in turn publish your binary

@Atlas We would like to also update the component field and it is known that Tridion does not allow to update the component while publishing it
– Abdul QadirOct 16 '18 at 9:57

The TOM.NET is indeed read only by default when used inside Templating. There is a setting however which can override this, but it is highly unrecommended because you defeat the purpose of security for example.
– Atila SosOct 16 '18 at 10:49