We have uploaded 0kB .xhtml file as binary component in Tridion and are trying to publish the binary using AddBinary.

Engine.PublishingContext.RenderedItem.AddBinary(binaryComponent, structureGroup)

When we publish the binary it is getting deployed as a 1kB file with NUL character.

Our requirement is to publish this as empty binary of 0kB.

Thanks for the help in advance.

  • Why do you need to publish a binary with 0 kb ? – Hiren Kaku Nov 18 '15 at 20:59
  • What are you trying to achieve, and what have you tried so far? Is the output 1Kb or a single byte? (In which case, perhaps a string terminator) Is it a kilobyte of NUL characters? – Dominic Cronin May 16 '16 at 15:06

Can you try this :

Engine.PublishingContext.RenderedItem.AddBinary(item.GetAsStream(),filename,filename,null,"MIME Type");
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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