[TYPO3-core] RFC #10717: No simple way to get the maximum upload size in TYPO3
Oliver Hader
oliver at typo3.org
Tue Mar 31 12:26:17 CEST 2009
Hi Benni,
Benjamin Mack schrieb:
> Hey,
>
> this is a SVN patch request.
>
> Branches: trunk.
>
> BT reference: http://bugs.typo3.org/view.php?id=10717
>
> Problem: This is a pre-requisite for the mass uploader. I often find it
> difficult to always check if the upload_max_filesize or post_max_size is
> lower than the $TYPO3_CONF_VARS['BE']['maxFileSize']. I introduced this
> feature so we can use it all through the backend in various cases to
> have a unified check. I found that without this function, the devs who
> want to upload always need to check against the various PHP limitation
> himself.
>
> Solution: Add a static function to t3lib_div (yes, I did not find a more
> suitable class to put in, that is always available).
>
> Notes: This can be helpful in a lot of cases. Also, I want to commit
> this separately before the mass uploader comes as it will make the "big
> part" easier to review.
The attached patch has the calculation of file sizes in bytes now
refactored to a new method in t3lib_div. I'm fine with having both new
methods in t3lib_div since it can be useful for other parts/extensions
as well.
Furthermore I've added a unit tests for the file size calculation out of
a string like "100k".
+1 on reading and testing
Go ahead and commit since it is a requirement for the mass file uploader.
olly
--
Oliver Hader
TYPO3 Release Manager 4.3
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0010717_v2.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090331/9b28e700/attachment.txt
More information about the TYPO3-team-core
mailing list