5
votes

We have an image with filename as "Tim%20Butler%20Trading.jpg". This image is linked as a component link in the "Image" field of the main component. In C# DLL we read this "Image" field and form image tag as follows:

"<img " + style + " src=\"" + imageID + "\" />" 

where style is the attribute name if any and imageID is the tcm id of the multimedia component.

Output string is formed using image, title and some other field values from the component. This output is pushed into package to access it in dwt. The contentType of the output string passed to dwt is "HTML".

We are using DefaultFinishActions to publish images. This image is getting deployed on presenation server as Tim%20Butler%20Trading34-13565.jpg but not getting resolved on presentation side.

In page source image tag is formed as follows:

<img src="/images/Tim%2520Butler%2520Trading34-13565.jpg"  class="img" />

We think that DWT is converting % in image file name to %25 when image is published.

Can someone let me know how to resolve this issue?

2
The page source image tag is not visible in your post! - Quirijn

2 Answers

6
votes

The problem is in % sign. When template sees % sign it is encoding it as %25.

All you need to do is stop encoding it yourself. If your template will output Tim Butler Trading.jpg, dreamweaver template will encode spaces as %20 and everyhting should work

0
votes

When the image is uploaded into Tridion, ensure that the filename contains no % characters.

Tim%20Butler%20Trading34-13565.jpg

should be

Tim Butler Trading34-13565.jpg

when you upload it into Tridion from your local system.

This based on the assumption you're not adding the TCMID to the filename during publishing (the 34-13565 part has the same data and almost the same format as a TCMURI...).