Copied to clipboard

Flag this post as spam?

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


  • Garrett Fisher 341 posts 496 karma points
    Oct 29, 2009 @ 17:02
    Garrett Fisher
    0

    Upload field - Filetype

    Hi,

     

    How do I access (and display in template) the Filetype of an object saved in an Upload field?

     

    Thanks,

    Garrett

  • dandrayne 1138 posts 2262 karma points
    Oct 29, 2009 @ 17:45
    dandrayne
    0

    (untested) Try adding a label datatype with an alias of

    umbracoExtension

    To the same document type that the upload field is on

    Dan

  • Garrett Fisher 341 posts 496 karma points
    Oct 29, 2009 @ 17:54
    Garrett Fisher
    0

    Thanks.

    What type of field would it be?  If the user has to enter it, it sort of defeats the purpose.  I'm trying to get this dynamically.  Any other ideas?

  • Garrett Fisher 341 posts 496 karma points
    Oct 29, 2009 @ 18:11
    Garrett Fisher
    0

    My XSLT:

    <xsl:value-of select="./data [@alias = 'umbracoExtension']"/>

    Nothing is showing up in the template.  And in the content tab, there is no uder-editable field.  I don't really understand what you're having me do here!

     

  • dandrayne 1138 posts 2262 karma points
    Oct 29, 2009 @ 18:21
    dandrayne
    0

    HI There -  here's an image!

    Hosted by imgur.com

    So, add a new property of type "label" and call it an alias of "umbracoExtension".  When you next upload a file using the upload field on the same document type the label will be populated with the file extension

    Now you can access this in xslt with something like

    <xsl:value-of select="$currentPage/data [@alias='umbracoExtension']" />

    Hope this helps,
    Dan

     

  • Garrett Fisher 341 posts 496 karma points
    Oct 29, 2009 @ 21:07
    Garrett Fisher
    0

    This worked-- thank you!  The ley was to do the Upload over again :)

Please Sign in or register to post replies

Write your reply to:

Draft