Page 1 of 1

[3.2.5]Limit attachment size by extension group

Posted: Sat May 25, 2019 8:13 pm
by BuSch
Hi, I'm new to phpBB-board administration, so maybe I misunderstood something.
I want to limit the attachment size for the extension type group "images" to a lower value than the general attachments (like documents).

So I set the attachment max size under "Posting settings\attachment settings" to 5 MB and that works fine.

To limit the maximum file size for images only, I tried to set the limit to 1 MB under "posting settings\manage extension groups" for the images extension group. That doesn't seem to work, as I can still upload a file with a size of over 4 MB.

Am I doing something wrong or did I miss something? My understanding is that the size limitation for extension groups was meant exactly for that.

Re: [3.2.5]Limit attachment size by extension group

Posted: Mon Jun 03, 2019 10:48 pm
by yehors
I just ended my investigation on this issue. It was not easy to find the roots of the problem but I have some results.

First, you are right about the functionality of group extensions, it must work as you wrote.

phpBB uses for the file uploading library called plupload, version is v1.5.7 (which is old now).
At the footer of the page where you can upload files, phpBB initializes the following javascript code:

Code: Select all

phpbb.plupload = {
// ...
config: { 
  runtimes: 'html5',
  url: './posting.php?mode=edit&f=2&t=1&p=9',
  max_file_size: '5242880b',
  // ...
  filters: [{title: 'Images', extensions: 'gif,png,jpeg,jpg,tif,tiff,tga'},{title: 'Archives', extensions: 'gtar,gz,tar,zip,rar,ace,torrent,tgz,bz2,7z'}],
// ...
Here we have a max_file_size field that equals to our setting of maximum file size (in bytes), but we don't have the same field for the filters.
In short, the plupload does not configure properly to check file sizes of images.

I just created an issue about this functionality in the plupload's repository. We'll see what developers say.

Re: [3.2.5]Limit attachment size by extension group

Posted: Mon Jun 03, 2019 11:01 pm
by yehors
Also, we must create a ticket in the phpBB tracker too. I will make it tomorrow.

Re: [3.2.5]Limit attachment size by extension group

Posted: Tue Jun 04, 2019 5:21 am
by yehors
I just created a ticket about the problem.

URL: https://tracker.phpbb.com/browse/PHPBB3-16076

Re: [3.2.5]Limit attachment size by extension group

Posted: Tue Jun 04, 2019 11:43 am
by John connor
Voted as this needs to be fixed.

Re: [3.2.5]Limit attachment size by extension group

Posted: Sun Jun 09, 2019 3:25 pm
by yehors
It seems like the pluplod does not have support. My issue has no reply for a week.

Re: [3.2.5]Limit attachment size by extension group

Posted: Wed Jun 12, 2019 4:19 pm
by BuSch
Too bad! But thanks anyway for creating the ticket.
I'm glad, that it's not my stupidity ;) :D

Re: [3.2.5]Limit attachment size by extension group

Posted: Wed Jun 12, 2019 9:40 pm
by BuSch
Is this topic marked as solved as it is recognised as bug and there seems to be no solution?

Re: [3.2.5]Limit attachment size by extension group

Posted: Wed Jun 12, 2019 9:56 pm
by yehors
BuSch wrote:
Wed Jun 12, 2019 9:40 pm
Is this topic marked as solved as it is recognised as bug and there seems to be no solution?
Don't think that solved, it may be in the future. People there - https://tracker.phpbb.com/browse/PHPBB3-16076 - upvoting the issue so maybe it will be solved.

Re: [3.2.5]Limit attachment size by extension group

Posted: Thu Jun 13, 2019 2:54 pm
by BuSch
yehors wrote:
Wed Jun 12, 2019 9:56 pm
Don't think that solved, it may be in the future. People there - https://tracker.phpbb.com/browse/PHPBB3-16076 - upvoting the issue so maybe it will be solved.
Yeah, but so far it seems that only John and I voted for it :?

Re: [3.2.5]Limit attachment size by extension group

Posted: Thu Jun 13, 2019 3:12 pm
by Lumpy Burgertushie
remember, just because one or one hundred users think it should be "fixed"/changed does not mean it ever will be.

and if it is decided that it should be addressed, it could take a couple of versions before it would even happen.
if it is not a major bug or a security issue the developers may not think it should be moved to the top of their lists of things to do.


luck,
robert

Re: [3.2.5]Limit attachment size by extension group

Posted: Thu Jun 13, 2019 11:00 pm
by BuSch
BuSch wrote:
Wed Jun 12, 2019 9:40 pm
Is this topic marked as solved as it is recognised as bug and there seems to be no solution?
Robert, this was not because I'm frustrated that there is no solution yet, I was just wondering about the check mark.

I do understand about priorities in development ;) and I must confess that this is a "nice to have" feature, not a major bug. :)
To begin with, I was just confused that there is an entry for size limitation per attachment type if it doesn't do anything.
All is well! I'll just sit and hope ..... :mrgreen:

Re: [3.2.5]Limit attachment size by extension group

Posted: Sun Aug 25, 2019 9:34 pm
by yehors
There's a pull request for the issue: https://github.com/phpbb/phpbb/pull/5664

:o