YaBB Community and Support Forum
YaBB Home About YaBB Download YaBB YaBB Support Customize Your Forum Development Contribute to the Project
  Welcome, Guest. Please Login or Register


 
Pages: 1 2 
Topic Tools
 
File attachment size (Read 1,844 times)
 Apr 9th, 2012 at 3:13am
There are no actions to perform.  

westwegoman 
Ex Member
*


YaBB 2.5
File attachment size
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 »  
Never use both feet to test the depth of the water
 
IP Logged  
 Reply #1 - Apr 9th, 2012 at 3:51am
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: File attachment size
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 »  
 
IP Logged  
 Reply #2 - Apr 10th, 2012 at 1:52am
There are no actions to perform.  

xnoddyx 
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline
Posts: 1,552
UK:Scotland/livingston


YaBB 2.5
Re: File attachment size
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)
WWW xnoddyx xnoddyx1  
IP Logged  
 Reply #3 - Apr 10th, 2012 at 2:04am
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,856
Earth


YaBB 2.5
Re: File attachment size
Do you have directory size limits turned on for the attachments directory?
 
WWW  
IP Logged  
 Reply #4 - Apr 10th, 2012 at 2:14am
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: File attachment size
That's a server error. How big was the file you were trying to upload?
 
 
IP Logged  
 Reply #5 - Apr 10th, 2012 at 2:28am
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,856
Earth


YaBB 2.5
Re: File attachment size
Derek Barnstorm wrote on Apr 10th, 2012 at 2:14am:
That's a server error.

Duh... Embarrassed
 
WWW  
IP Logged  
 Reply #6 - Apr 10th, 2012 at 2:37am
There are no actions to perform.  

xnoddyx 
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline
Posts: 1,552
UK:Scotland/livingston


YaBB 2.5
Re: File attachment size
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)
WWW xnoddyx xnoddyx1  
IP Logged  
 Reply #7 - Apr 10th, 2012 at 3:23am
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,856
Earth


YaBB 2.5
Re: File attachment size
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.
 
WWW  
IP Logged  
 Reply #8 - Apr 10th, 2012 at 4:00am
There are no actions to perform.  

xnoddyx 
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline
Posts: 1,552
UK:Scotland/livingston


YaBB 2.5
Re: File attachment size
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)
WWW xnoddyx xnoddyx1  
IP Logged  
 Reply #9 - Apr 10th, 2012 at 6:29am
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,856
Earth


YaBB 2.5
Re: File attachment size
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...'
 
WWW  
IP Logged  
 Reply #10 - Apr 10th, 2012 at 12:20pm
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: File attachment size
It's the CGI.pm POST_MAX variable which is causing it, but I haven't found the solution yet I'm afraid. Undecided
 
 
IP Logged  
 Reply #11 - Apr 10th, 2012 at 12:33pm
There are no actions to perform.  

xnoddyx 
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline
Posts: 1,552
UK:Scotland/livingston


YaBB 2.5
Re: File attachment size
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)
WWW xnoddyx xnoddyx1  
IP Logged  
 Reply #12 - Apr 10th, 2012 at 12:41pm
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: File attachment size
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
 
 
IP Logged  
 Reply #13 - Apr 10th, 2012 at 1:35pm
There are no actions to perform.  

westwegoman 
Ex Member
*


YaBB 2.5
Re: File attachment size
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.

 
Never use both feet to test the depth of the water
 
IP Logged  
 Reply #14 - Apr 10th, 2012 at 2:28pm
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,856
Earth


YaBB 2.5
Re: File attachment size
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
 
WWW  
IP Logged  
Pages: 1 2 
Topic Tools
 

Get Yet another Bulletin Board at SourceForge.net. Fast, secure and Free Open Source software downloads Support This Project BoardMod - YaBB features and templates YaBB Codex - support on installation and usage YaBB Toolbar for your browser

YaBB Facebook Group Page

Vulnerability Scanner

Valid RSS Valid XHTML Valid CSS Powered by Perl
YaBB Chat and Support Community » Powered by YaBB 3.0 Beta!
YaBB Forum Software © 2000-2011. All Rights Reserved.