|
Cookbook /
AttachSizeSummary: Get file sizes of attached files
Version: 0.1
Prerequisites: None
Status: Alpha
Maintainer: Nobody, feel free to modify or take over
Categories: Uploads
Questions answered by this recipeHow can I display the size of attached files? DescriptionCustom markup to get the file size of attached files To install this recipe:
include_once("$FarmD/cookbook/AttachSize.php");
To use, simply use this markup:
Notes
Release Notes
See AlsoContributorsCommentsNote that as it is now, the recipe will allow the presence & size of any file accessible via the PHP script to be determined. To fix, take a look at what HandleDownload() in scripts/upload.php does when downloading an attached file. Also, for a relatively robust file size > string converter, take a look at Attachtable's AttachFilesizeString(), eg. from line 269 of thisΔ. —Eemeli Aro May 27, 2009, at 02:46 AM The presence & size disclosure vulnerability is now fixed.
I didn't bother with the more involved formatting because (1) uploads over 10MB are highly unlikely (do I really need to format petabytes correctly?) and (2) someone would very quickly come along asking for additional formatting like KiB, "octets", etc. Maxim? 2009-05-27
User notes?: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date * (-) Optional negative comment. Name, date These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |