Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 16, 2012 @ 20:36
    Fuji Kusaka
    0

    Display umbracoBytes from uploaded file

    Anyone can explain how do i actually display file size (umbracoBytes) of an uploaded pdf file from a node itself. 

    Here am not making use of the media section, so each node has an upload file where i can upload pdf file related to the page content. Now i need to display the file size of the pdf. 

    How do i to do this since i dont have any umbracoBytes alias ?

    Any suggestions most welcome

     

    //fuji

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Oct 16, 2012 @ 22:32
    Chriztian Steinmeier
    2

    Hi Fuji,

    I can only think of two solutions:

    1. Add a "Label" type property with the alias umbracoBytes to the doctype - it won't work for existing files, but any new uploads will automatically get their filesizes filled in (at least that's what I'd assume).

    2. Check if uComponents has an extension for this...

    /Chriztian

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Oct 16, 2012 @ 22:36
    Tom Fulton
    1

    Beat me to it!  If you have uComponents, you can use:

    @uComponents.XsltExtensions.IO.GetFileSize(Model.uploadFile)

    -Tom

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 17, 2012 @ 06:31
    Fuji Kusaka
    0

    Hi guys,

    @Chriztian this is exactly what i did, adding a new property in my doctype with alias umbracoBytes, but as mentioned it did the trick only when i uploaded a new file not existing ones.

    @Tom thanks for pointing out uComponents, will have a try at both suggestions. 

    //fuji

Please Sign in or register to post replies

Write your reply to:

Draft