attachment path

Peter Mogilnitski asked on August 24, 2016 16:15


We have a field (for ex image2) defined as text but form control is “media selection”. So now if I upload an image as an attachment via media libraries tab, Everything is fine: When I do in transformation <img src="<%# Eval("Image2")%>" /> - everything is ok – no rewrites or redirects! perfectly rendered. No rewrites or redirects.

BUT if If instead of using media libraries I use attachments tab the transformation will render it like

The problem is that this will be redirected/rewritten to when a browser is downloading this image.

This rewrite is not good from SEO prospective and we need to avoid it.

Is there a way to render the final URL?

Thanks, Peter

Correct Answer

Peter Mogilnitski answered on August 25, 2016 17:31

This case is the configuration settings: \System\Performance\Redirect files to disk - must be unchecked.

1 votesVote for this answer Unmark Correct answer

Recent Answers

Chetan Sharma answered on August 24, 2016 17:28

<%# GetAttachmentUrl(Eval<string>("AttachmentName"), Eval<string>("NodeAliasPath")) %>

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.