If this is done with the build in datatypes file or image or via uploadfield umbraco stores some additional informations as generic properties: umbracoBytes, umbracoWidth, umbracoHeight, umbracoExtension you can get via eg: data [@alias = 'umbracoBytes']
You could divide the result by 1048576 and truncate the result to your required amount of decimal places. http://www.exslt.org/math/index.html should fill any gaps in normal xslt (although I don't think they're needed).
An interesting one though - if I had more time free I'd try to come up with some sample code, do post back if you think you'll need it
mediaPicker: getting filesize from selected files?
any chance i can get filesize outputtet with the nodeName of my resultset? :-)
with this method:
<xsl:for-each select="umbraco.library:GetMedia(./data[@alias = $mediaFolderSelected], 'true')/node">
If this is done with the build in datatypes file or image or via uploadfield umbraco stores some additional informations as generic properties: umbracoBytes, umbracoWidth, umbracoHeight, umbracoExtension you can get via eg: data [@alias = 'umbracoBytes']
hth, Thomas
but then how would one go about reformatting it into Mb? :-)
found it .. :-)
<xsl:decimal-format name="mb" decimal-separator="," grouping-separator="."/>
<xsl:value-of select="format-number((((data [@alias = 'umbracoBytes']) div 1024) div 1024), '#.###,##', 'mb')"/><br />
You could divide the result by 1048576 and truncate the result to your required amount of decimal places. http://www.exslt.org/math/index.html should fill any gaps in normal xslt (although I don't think they're needed).
An interesting one though - if I had more time free I'd try to come up with some sample code, do post back if you think you'll need it
is working on a reply...