21282 Posts in 5730 Topics by 2601 members
General questions about getting started with SilverStripe that don't fit in any of the categories above.
|Go to End|
14 September 2012 at 8:31pm
There was a need to display the size of the downloaded user file, and I have decided it is simple:
$userID = Member :: currentUserID ();
return File :: get () -> filter (array ("OwnerID" => "$userID"));
and in the template as follows:
<% Control SomeFunction%>
File Name: $Name | File Size: $Size
And there were no questions.
But there is another need - to prevent a user to download a file, if it has already reached the limit on the total size of all files, for example, the limit of N mb. I read the manual, but did not understand what to do. If the table "File", it would be a field "Size", I think I would have found the answer, but it is not there Should I use $Size somewhere inside SomeFunction? Tell me, please, what to do?
Can I do without creating an extra class File (for example, UserFiles extend File)?
|Go to Top|