Page Index Toggle Pages: [1] 2 
Topic Tools
Hot Topic (More than 10 Replies) File attachment size (Read 2,120 times)
westwegoman
Ex Member
**




YaBB 2.5.2
File attachment size
Apr 9th, 2012 at 3:13am
Post Tools
If it is possible, how can I alter YaBB to still have attachment size limits for members but allow admins sizes to be larger or be unlimited.

Using 2.5AE

Thanks.
« Last Edit: Apr 9th, 2012 at 3:13am by WestwegoMan »  
Back to top
 
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: File attachment size
Reply #1 - Apr 9th, 2012 at 3:51am
Post Tools
Hi again Merv,

For no limits, this should do the trick:

In Sources/Post.pl find:

Code (Perl)
Select All
            if ($limit && $filesize > (1024 * $limit)) { 


And replace with:

Code (Perl)
Select All
            if (!$iamadmin && $limit && $filesize > (1024 * $limit)) { 



« Last Edit: Apr 9th, 2012 at 3:53am by Derek Barnstorm »  
Back to top
 
IP Logged
 
xnoddyx
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline



Posts: 1,591
Location: UK:Scotland/livingston

None
Re: File attachment size
Reply #2 - Apr 10th, 2012 at 1:52am
Post Tools
Derek Barnstorm wrote on Apr 9th, 2012 at 3:51am:
Hi again Merv,

For no limits, this should do the trick:

In Sources/Post.pl find:

Code (Perl)
Select All
            if ($limit && $filesize > (1024 * $limit)) { 


And replace with:

Code (Perl)
Select All
            if (!$iamadmin && $limit && $filesize > (1024 * $limit)) { 





with this i still get
Code
Select All
The last POST request did output an error message: 413 Request entity too large 

  

YaBB install help video
1. what yabb forum are you running and the url
2. describe in as much detail as you can what happens and also post screenshots if you can
3. please be patient we live in different time zones and have other commitments but we will help you
as bill and ted say (Be excellent to each other)
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Online



Posts: 2,449
Location: Earth

YaBB 2.6.1
Re: File attachment size
Reply #3 - Apr 10th, 2012 at 2:04am
Post Tools
Do you have directory size limits turned on for the attachments directory?
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: File attachment size
Reply #4 - Apr 10th, 2012 at 2:14am
Post Tools
That's a server error. How big was the file you were trying to upload?
  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Online



Posts: 2,449
Location: Earth

YaBB 2.6.1
Re: File attachment size
Reply #5 - Apr 10th, 2012 at 2:28am
Post Tools
Derek Barnstorm wrote on Apr 10th, 2012 at 2:14am:
That's a server error.

Duh... Embarrassed
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
xnoddyx
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline



Posts: 1,591
Location: UK:Scotland/livingston

None
Re: File attachment size
Reply #6 - Apr 10th, 2012 at 2:37am
Post Tools
Dandello wrote on Apr 10th, 2012 at 2:04am:
Do you have directory size limits turned on for the attachments directory?


yes its 100000KB

Derek Barnstorm wrote on Apr 10th, 2012 at 2:14am:
That's a server error. How big was the file you were trying to upload?
 Roll Eyes

the file was 8.24MB or 8440 KB and i dont get the error when i set the file size to more than the size of the file and uploads with no probs so its not a server error lol  Wink
« Last Edit: Apr 10th, 2012 at 2:39am by xnoddyx »  

YaBB install help video
1. what yabb forum are you running and the url
2. describe in as much detail as you can what happens and also post screenshots if you can
3. please be patient we live in different time zones and have other commitments but we will help you
as bill and ted say (Be excellent to each other)
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Online



Posts: 2,449
Location: Earth

YaBB 2.6.1
Re: File attachment size
Reply #7 - Apr 10th, 2012 at 3:23am
Post Tools
I'm thinking the '!' is missing from "!$iamadmin".

Roughly translated into English that function reads: If there is a size limit and the file being uploaded is larger than the limit, stop and complain.

Derek's addition is supposed to make it read: If the poster is not an admin and if there is a size limit and the file being uploaded is larger than the limit, stop and complain.

It's still stopping and complaining.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
xnoddyx
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline



Posts: 1,591
Location: UK:Scotland/livingston

None
Re: File attachment size
Reply #8 - Apr 10th, 2012 at 4:00am
Post Tools
Dandello wrote on Apr 10th, 2012 at 3:23am:
I'm thinking the '!' is missing from "!$iamadmin".

Roughly translated into English that function reads: If there is a size limit and the file being uploaded is larger than the limit, stop and complain.

Derek's addition is supposed to make it read: If the poster is not an admin and if there is a size limit and the file being uploaded is larger than the limit, stop and complain.

It's still stopping and complaining.


Sad no i had !$iamadmin and when that dident work i removed the ! and just had $iamadmin and got the same error then i tryed adding a new line with "else and !$iamadmin some more code" but it just spat a Untrapped Error : syntax error at  out at me
so posted here that the "!$iamadmin dident work for me and then i will setup a test board tomorrow and then see how i can syntax the code so i can add a else or else if or something im in no way any good with perl but i will give it a good go  Smiley and if it dont work oh well  Embarrassed lol Smiley
« Last Edit: Apr 10th, 2012 at 4:00am by xnoddyx »  

YaBB install help video
1. what yabb forum are you running and the url
2. describe in as much detail as you can what happens and also post screenshots if you can
3. please be patient we live in different time zones and have other commitments but we will help you
as bill and ted say (Be excellent to each other)
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Online



Posts: 2,449
Location: Earth

YaBB 2.6.1
Re: File attachment size
Reply #9 - Apr 10th, 2012 at 6:29am
Post Tools
Okay, I know this sounds like a stupid question - but I've done it to myself before - are you absolutely sure you were logged in as admin?

Plus since that section of code is for denying an oversize file, I don't see any way to turn it into an 'allow exception' code. Derek's solution is the most logical way to create an exception for the admin by adding 'if poster is not admin...'
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: File attachment size
Reply #10 - Apr 10th, 2012 at 12:20pm
Post Tools
It's the CGI.pm POST_MAX variable which is causing it, but I haven't found the solution yet I'm afraid. Undecided
  
Back to top
 
IP Logged
 
xnoddyx
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline



Posts: 1,591
Location: UK:Scotland/livingston

None
Re: File attachment size
Reply #11 - Apr 10th, 2012 at 12:33pm
Post Tools
yes it was the defalt admin ac i will copy over the forum to a new dir to test it agen and if its still the same i will give you a admin ac and ftp logon info and you can test and look for your self and will do the same for Derek as well i have never had any prob with any of Derek's code thats why i was like  Shocked when it dident work my forum has lots of mods and code edits apart from Backup.pl i havent made any code edits to the forum that has to do with dris or files apart from the mods that it has.

Derek Barnstorm wrote on Apr 10th, 2012 at 12:20pm:
It's the CGI.pm POST_MAX variable which is causing it, but I haven't found the solution yet I'm afraid. Undecided

ah ok i will give you admin and ftp to the forum when i copy it over to a new dir and pm you the info  Smiley
« Last Edit: Apr 10th, 2012 at 12:37pm by xnoddyx »  

YaBB install help video
1. what yabb forum are you running and the url
2. describe in as much detail as you can what happens and also post screenshots if you can
3. please be patient we live in different time zones and have other commitments but we will help you
as bill and ted say (Be excellent to each other)
Back to top
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: File attachment size
Reply #12 - Apr 10th, 2012 at 12:41pm
Post Tools
xnoddyx wrote on Apr 10th, 2012 at 12:33pm:
ah ok i will give you admin and ftp to the forum when i copy it over to a new dir and pm you the info

No need, Noddy. I can reproduce it on my test board - I just haven't solved it yet. Smiley
  
Back to top
 
IP Logged
 
westwegoman
Ex Member
**




YaBB 2.5.2
Re: File attachment size
Reply #13 - Apr 10th, 2012 at 1:35pm
Post Tools
I got stuck working another 18 hour shift so, I just got around to trying it. Didn't work for me either. Not a big deal.

  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Online



Posts: 2,449
Location: Earth

YaBB 2.6.1
Re: File attachment size
Reply #14 - Apr 10th, 2012 at 2:28pm
Post Tools
Derek Barnstorm wrote on Apr 10th, 2012 at 12:20pm:
It's the CGI.pm POST_MAX variable which is causing it, but I haven't found the solution yet I'm afraid. Undecided


Ah, so the problem isn't with Derek's code but somewhere else... I don't feel so Duh now. Embarrassed
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 2 
Topic Tools
 
  « Board Index ‹ Board  ^Top