UmbracoBytes

HI All,

Can someone explain how to display fileSize in Razor??

Same as you would do in XSLT.

 <xsl:variable name="fileSize" select="umbracoBytes"/>
          <xsl:choose>
          <xsl:when test="$fileSize &gt;= 1048576">
            <xsl:value-of select="round($fileSize div 1048576)"/> MB              
          </xsl:when>
          <xsl:when test="$fileSize &gt;= 1024">
            <xsl:value-of select="round($fileSize div 1024)"/> KB            
          </xsl:when>
        <xsl:otherwise>
             <xsl:text>0 Bytes</xsl:text>
        </xsl:otherwise>
    </xsl:choose>        

Any Suggestions?

//fuji


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/31407-umbracobytes