[3.2.5]Limit attachment size by extension group

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
BuSch
Registered User
Posts: 11
Joined: Sat May 25, 2019 7:53 pm
Location: Germany
Name: Burghard

[3.2.5]Limit attachment size by extension group

Post by BuSch » Sat May 25, 2019 8:13 pm

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.

User avatar
yehors
Registered User
Posts: 31
Joined: Sat Jun 01, 2019 2:33 pm
Name: Yehor Smoliakov

Re: [3.2.5]Limit attachment size by extension group

Post by yehors » Mon Jun 03, 2019 10:48 pm

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.
If you have a question, feel free to drop a message by PM or e-mail to me.

User avatar
yehors
Registered User
Posts: 31
Joined: Sat Jun 01, 2019 2:33 pm
Name: Yehor Smoliakov

Re: [3.2.5]Limit attachment size by extension group

Post by yehors » Mon Jun 03, 2019 11:01 pm

Also, we must create a ticket in the phpBB tracker too. I will make it tomorrow.
If you have a question, feel free to drop a message by PM or e-mail to me.

User avatar
yehors
Registered User
Posts: 31
Joined: Sat Jun 01, 2019 2:33 pm
Name: Yehor Smoliakov

Re: [3.2.5]Limit attachment size by extension group

Post by yehors » Tue Jun 04, 2019 5:21 am

I just created a ticket about the problem.

URL: https://tracker.phpbb.com/browse/PHPBB3-16076
If you have a question, feel free to drop a message by PM or e-mail to me.

User avatar
John connor
Registered User
Posts: 2118
Joined: Fri Nov 14, 2014 5:14 pm
Location: U S Of A
Name: Aaron
Contact:

Re: [3.2.5]Limit attachment size by extension group

Post by John connor » Tue Jun 04, 2019 11:43 am

Voted as this needs to be fixed.

User avatar
yehors
Registered User
Posts: 31
Joined: Sat Jun 01, 2019 2:33 pm
Name: Yehor Smoliakov

Re: [3.2.5]Limit attachment size by extension group

Post by yehors » Sun Jun 09, 2019 3:25 pm

It seems like the pluplod does not have support. My issue has no reply for a week.
If you have a question, feel free to drop a message by PM or e-mail to me.

BuSch
Registered User
Posts: 11
Joined: Sat May 25, 2019 7:53 pm
Location: Germany
Name: Burghard

Re: [3.2.5]Limit attachment size by extension group

Post by BuSch » Wed Jun 12, 2019 4:19 pm

Too bad! But thanks anyway for creating the ticket.
I'm glad, that it's not my stupidity ;) :D

BuSch
Registered User
Posts: 11
Joined: Sat May 25, 2019 7:53 pm
Location: Germany
Name: Burghard

Re: [3.2.5]Limit attachment size by extension group

Post by BuSch » 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?

User avatar
yehors
Registered User
Posts: 31
Joined: Sat Jun 01, 2019 2:33 pm
Name: Yehor Smoliakov

Re: [3.2.5]Limit attachment size by extension group

Post by yehors » Wed Jun 12, 2019 9:56 pm

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.
If you have a question, feel free to drop a message by PM or e-mail to me.

BuSch
Registered User
Posts: 11
Joined: Sat May 25, 2019 7:53 pm
Location: Germany
Name: Burghard

Re: [3.2.5]Limit attachment size by extension group

Post by BuSch » Thu Jun 13, 2019 2:54 pm

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 :?

User avatar
Lumpy Burgertushie
Registered User
Posts: 66335
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: [3.2.5]Limit attachment size by extension group

Post by Lumpy Burgertushie » Thu Jun 13, 2019 3:12 pm

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
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

BuSch
Registered User
Posts: 11
Joined: Sat May 25, 2019 7:53 pm
Location: Germany
Name: Burghard

Re: [3.2.5]Limit attachment size by extension group

Post by BuSch » Thu Jun 13, 2019 11:00 pm

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:

Post Reply

Return to “[3.2.x] Support Forum”