flaithbheartaigh / dynamic-delivery-4-tridion

Automatically exported from code.google.com/p/dynamic-delivery-4-tridion
Other
0 stars 0 forks source link

Adding multiple binaries for the same component results in wrong mimetype #60

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Call AddBinary with e.g. a pdf.
2. Call AddBinary with the same component with e.g. an XML stream with a 
different mimetype ("text/xml")
3. Retrieve the binary from DD4T, the mimetype of the pdf appears to be 
"text/xml", whereas the expected output is mimetype "application/pdf".

DD4T version 1.0 is used with Tridion 2011SP1HR2.

Call to add binary (for the XML file) is as follows:
binary = m_Engine.PublishingContext.RenderedItem.AddBinary(item.GetAsStream(), 
CreateIndexDataFilename(filename), variant, comp, mimetype);

In the transport package the "binaries.xml" file contains the following:
<Binaries>
  <Binary Id="tcm:163-25731">
    <Path>\media\pdf_title_tcm163-25731.pdf</Path>
    <URL>/media/pdf_title_tcm163-25731.pdf</URL>
    <Type>application/pdf</Type>
  </Binary>
  <Binary Id="tcm:163-25731" VariantId="searchData">
    <Path>\media\pdf_title_tcm163-25731_pdf.indexdata</Path>
    <URL>/media/pdf_title_tcm163-25731_pdf.indexdata</URL>
    <Type>text/xml</Type>
  </Binary>
  <Binary Id="tcm:163-25731" VariantId="searchData">
    <Path>\media\pdf_fixed_title_pdf.indexdata</Path>
    <URL>/media/pdf_fixed_title_pdf.indexdata</URL>
    <Type>text/xml</Type>
  </Binary>
</Binaries>

Original issue reported on code.google.com by clemens....@hinttech.com on 22 Apr 2015 at 10:40

GoogleCodeExporter commented 8 years ago
DD4T Version: DD4T-Tridion-2011sp1 1.31.0

Original comment by clemens....@hinttech.com on 22 Apr 2015 at 11:27