Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Sep 13, 2013 @ 10:40
    Anthony Candaele
    0

    accessing file name + extension with Damp Property Editor Value Converter

    Hi,

    Is there a way to get to the filename and extension with the Damp Editor Property Editor Value Converter ?

    Now I'm using this code:

    var document = Model.Content.GetPropertyValue<DAMP.PropertyEditorValueConverter.Model>("mediaArticleDocument");

        var filename = document.First.Name;

     

    but this give me the file name without the extension.

    "media_article_filename"

    What I would like is to get the filename with the extension

    eg. "media_article_filename.pdf"

     

    Thanks for your help,

    Anthony

  • Ali Sheikh Taheri 470 posts 1647 karma points c-trib
    Sep 13, 2013 @ 12:35
    Ali Sheikh Taheri
    100

    Hi

    this will give you extension

    document.First.Media.umbracoExtension
    

    then you can concatenate it with yourfile name.

    string.format("{0}.{1}",document.First.Name,document.First.Media.umbracoExtension)
    
  • Anthony Candaele 1197 posts 2049 karma points
    Sep 13, 2013 @ 13:43
    Anthony Candaele
    0

    Hi Ali, thanks a lot,

    I was hoping there was some kind of convenient property but this works as a charm : )

    greetings,

    Anthony

Please Sign in or register to post replies

Write your reply to:

Draft