? ? Success

User tests: Successful: Unsuccessful:

avatar Kubik-Rubik
Kubik-Rubik
25 Sep 2014

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!

avatar Kubik-Rubik Kubik-Rubik - open - 25 Sep 2014
avatar jissues-bot jissues-bot - change - 25 Sep 2014
Labels Added: ?
avatar Bakual
Bakual - comment - 25 Sep 2014

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.

avatar Bakual Bakual - test_item - 25 Sep 2014 - Tested successfully
avatar Kubik-Rubik Kubik-Rubik - change - 25 Sep 2014
The description was changed
avatar Kubik-Rubik
Kubik-Rubik - comment - 25 Sep 2014

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.

avatar zero-24
zero-24 - comment - 26 Sep 2014

@Kubik-Rubik can you add the @since Tags to the new functions?

avatar zero-24 zero-24 - change - 26 Sep 2014
Category Libraries
avatar infograf768 infograf768 - change - 26 Sep 2014
Labels Added: ?
avatar Kubik-Rubik
Kubik-Rubik - comment - 26 Sep 2014

@zero-24 Sure, we have the version 13.1 now?

avatar Kubik-Rubik
Kubik-Rubik - comment - 26 Sep 2014

Done! Please test it.

avatar brianteeman
brianteeman - comment - 26 Sep 2014

I've not tested but we had an issue in the past when the value was in Gigabytes

avatar Kubik-Rubik
Kubik-Rubik - comment - 26 Sep 2014

@brianteeman That's not a problem in my implementation (just tested it to be sure).

avatar brianteeman
brianteeman - comment - 26 Sep 2014

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/

avatar zero-24
zero-24 - comment - 26 Sep 2014

@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 :smile:

avatar Kubik-Rubik
Kubik-Rubik - comment - 26 Sep 2014

@zero-24 I just took the version that is displayed in the information screen:

Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

avatar Bakual
Bakual - comment - 26 Sep 2014

Use 3.4. The platform is long gone and the file just happens to be an old one apparently :)

avatar Kubik-Rubik
Kubik-Rubik - comment - 26 Sep 2014

@Bakual Okay, changed it to 3.4. Thanks!

avatar beat
beat - comment - 26 Sep 2014

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) )

avatar brianteeman
brianteeman - comment - 26 Sep 2014

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/

avatar N6REJ
N6REJ - comment - 26 Sep 2014

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.

avatar roland-d
roland-d - comment - 26 Sep 2014

@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/.

avatar wilsonge wilsonge - change - 26 Sep 2014
Status Pending Ready to Commit
avatar wilsonge
wilsonge - comment - 26 Sep 2014

RTC

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar brianteeman
brianteeman - comment - 26 Sep 2014

Yes my typo

avatar N6REJ
N6REJ - comment - 26 Sep 2014

RTC

This comment was created with the J!Tracker Application at http://issues.joomla.org/.

avatar roland-d roland-d - test_item - 26 Sep 2014 - Tested successfully
avatar infograf768 infograf768 - change - 27 Sep 2014
Labels Added: ?
avatar phproberto
phproberto - comment - 2 Oct 2014

Merged into 3.4-dev branch a1afeba

Thanks!

avatar phproberto phproberto - close - 2 Oct 2014
avatar phproberto phproberto - change - 2 Oct 2014
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2014-10-02 00:42:09
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment