Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Today 09:17:30

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,901
GitHub

How do I find the file size but omit the unit?

I can use this in a file form:

<txp:file_download_size decimals="0" format="b" />

The output would be akin to:

102615 B

Is there a tag-native way to chop out of the B suffix, please? My use case is an XML enclosure for a podcast:

<enclosure url="https://example.com/episode001.mp3" length="102615" type="audio/mpeg />

Offline

#2 Today 09:59:26

phiw13
Plugin Author
From: East Asia
Registered: 2004-02-27
Posts: 3,706
Website

Re: How do I find the file size but omit the unit?

trim=" B" ?


In low-power mode.
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#3 Today 10:02:30

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,901
GitHub

Re: How do I find the file size but omit the unit?

phiw13 wrote #343481:

trim=" B" ?

Perfect. Thank you!

Offline

Board footer

Powered by FluxBB