AttachSize

Summary: Get file sizes of attached files
Version: 0.1
Prerequisites: None
Status: Alpha
Maintainer: Nobody, feel free to modify or take over
Discussion: AttachSize-Talk
Categories: Uploads

Questions answered by this recipe

How can I display the size of attached files?

Description

Custom markup to get the file size of attached files

To install this recipe:

  • download Attach:AttachSize.phpΔ
  • copy it to your cookbook directory
  • add in your config.php or farmconfig.php this line:
include_once("$FarmD/cookbook/AttachSize.php");

To use, simply use this markup:

(:attachsize filename.ext:)

Notes

  • File sizes are all returned as the nearest whole number of KB, or the number of bytes below 1KB. It doesn't show MB, but then attachments are generally not that large anyway. Possible future enhancements could improve this.
  • Formatting is hard-coded.

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

2009-5-26
0.1: Initial release
2009-6-1
0.2: Cross-group attachment checking, can't get info on existence/size of non-attachments any more

See Also

Contributors

Maxim?

Comments

See discussion at AttachSize-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.