User tests: Successful: Unsuccessful:
Reference and discussion: Template upload size #4337
Call it with JFilesystemHelper::fileUploadMaxSize(); from anywhere you need to get the maximum upload file size!
How to test?
Change the 'post_max_size' and 'upload_max_filesize' (in the php.ini) and check whether you get the correct maximum size with the call mentioned above!
Labels |
Added:
?
|
Optimized code with the new PR. Please test it one more time!
Now you have the possibility to get the maximum upload size in Bytes without the appropriate unit if you want to do some calculations with it. Just set the first parameter to false
:
JFilesystemHelper::fileUploadMaxSize(false);
If you set true
or no parameter, then you will get a string with the size and the unit which can be used to display the limitation in the template.
Example:
I set both values to 64M in the php.ini. The output with true as the parameter is 64M, with false 67108864.
@Kubik-Rubik can you add the @since Tags to the new functions?
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Done! Please test it.
I've not tested but we had an issue in the past when the value was in Gigabytes
@brianteeman That's not a problem in my implementation (just tested it to be sure).
Great - just thought I should mention it
On 26 September 2014 09:44, Viktor Vogel notifications@github.com wrote:
@brianteeman https://github.com/brianteeman That's not a problem in my
implementation (just tested it to be sure).—
Reply to this email directly or view it on GitHub
#4348 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
@zero-24 Sure, we have the version 13.1 now?
@Kubik-Rubik iirc we have no future versions of the platform so i would vote to use 3.4 for the @since tags
Use 3.4. The platform is long gone and the file just happens to be an old one apparently :)
It would be cool if the library would have an additional function that allow to show a string to display that optionally (in admin area only) shows the origin of the limit, like e.g.
Maximum File Size: 2M (upload_max_filesize in /etc/php5/cgi/php.ini)
(as I just commented here: #4355 (comment) )
See my comment in #4335 against this idea
On 26 September 2014 14:48, beat notifications@github.com wrote:
It would be cool if the library would allow to show a string to display
that optionally (in admin area only) shows the origin of the limit, like
e.g.Maximum File Size: 2M (upload_max_filesize in /etc/php5/cgi/php.ini)
(as I just commented here: #4355 (comment)
#4355 (comment) )—
Reply to this email directly or view it on GitHub
#4348 (comment).
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
Created Article with {source}
<?php
$test = JFilesystemHelper::fileUploadMaxSize();
echo $test;
?>
{/source} it reported 8M, then checked "warnings" section of extension manager and it reported difference in size correctly, installed patch, and checked again, it reported changed value properly ( 32m ) and notice went away in warning section.
CONCLUSION; WORKS AS CODED.
@brianteeman the issue he refers to is #4355 and not #4335.
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Status | Pending | ⇒ | Ready to Commit |
RTC
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Yes my typo
RTC
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-02 00:42:09 |
Labels |
Removed:
?
|
Used it in my component to replace my own function. Worked fine both in front- and backend.
There are some Codestyle issues Travis complains about.