Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Malte Baden Hansen 61 posts 158 karma points
    Aug 03, 2010 @ 16:08
    Malte Baden Hansen
    0

    GetMedia returns path but it messes up extension

    Hi

    When GetMedia returns the path for my media, it adds numbers and the extension, but without a dot before the extension, therefore messing up the path.

    It should look like this
    /media/1224/myimage[1].jpg

    But instead it looks like this
    /media/1224/myimage[1].jpg47560755286jpg

    Im new to umbraco, so im kinda lost on what todo?
    Thanks in advance!

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 03, 2010 @ 16:13
    Jeroen Breuer
    0

    Have a look at the solution of this topic. You've got the same problem: http://our.umbraco.org/forum/core/41-feedback/10539-mediaCurrent-and-Macro-container

    Jeroen

  • dandrayne 1138 posts 2262 karma points
    Aug 03, 2010 @ 16:14
    dandrayne
    0

    You need to use

    umbraco.library:GetMedia($mediaId, false())/umbracoFile

    Hope this helps,
    Dan

  • Malte Baden Hansen 61 posts 158 karma points
    Aug 03, 2010 @ 16:19
    Malte Baden Hansen
    0

    Ahh, thank you very much :)

  • Malte Baden Hansen 61 posts 158 karma points
    Aug 03, 2010 @ 16:48
    Malte Baden Hansen
    0

    When i do that, it outputs nothing.

    umbraco.library:GetMedia($mediaId, false())/@umbracoFile

    What am i doing wrong?

    Thanks for your quick response :)

  • Malte Baden Hansen 61 posts 158 karma points
    Aug 03, 2010 @ 16:50
    Malte Baden Hansen
    0

    I figured it out :)

    umbraco.library:GetMedia($mediaId, false())/data [@alias = 'umbracoFile']

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 03, 2010 @ 18:19
    Jeroen Breuer
    0

    Seems your still using Umbraco 4.0.x. The examples were for Umbraco 4.5.x. The example you used 2 posts ago was also wrong. 

    umbraco.library:GetMedia($mediaId, false())/@umbracoFile

    This should be 

    umbraco.library:GetMedia($mediaId, false())/umbracoFile

    You don't need the @ because it's not an attirbute, but an element.

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft