Hi guys,
Has anyone had an experience or success getting PHX or another snippet to read and output the filesize of a file/image specified in a TV? Idea is to do this at render-time, but other suggestions would be apprecaited too!
Cheers,
Dave
You could do it with a custom PHX modifier, but since you’d have to write your own snippet for that, you might just as well just do it with a snippet. You can send the file path as a property to the snippet and have the snippet get the file size in PHP and return it:
return filesize($filePath);
The size will be returned in bytes, but you could change it to whatever you want in the snippet.
Thanks BobRay - much appreciated. Processing time is probably going to be our next hurdle as there are a number of files being read...
Quote from: Dave at Jul 27, 2011, 05:53 AM
Thanks BobRay - much appreciated. Processing time is probably going to be our next hurdle as there are a number of files being read...
The snippet would definitely be faster than PHX here. PHX would search through all the other modifiers before exhausting the list and looking for your custom one.