Who’s your webhost?
And what versions of WP and BP are you running?
my webhost : http://downtownhost.com
WP 3.0
BP 1.2.5.2
Album 0.1.9 Nightly ver
OK i fixed the error myself by removing these lines from sub-upload-http.php , but also effectively getting rid of the size cap altogether.
if ( $_FILES > BP_AVATAR_ORIGINAL_MAX_FILESIZE ) {
$feedback_message[] = sprintf( __( ‘The file you uploaded is too big. Please upload a file under %s’, ‘buddypress’), size_format(CORE_MAX_FILE_SIZE) );
$error_flag = true;
}
can upload every file now! Should I just replace BP_AVATAR_ORIGINAL_MAX_FILESIZE with a integer filesize within the PHP file instead? And If so how?
Also, when the plugin updates, I’d have to re-edit this file , correct?
Try putting a line in your wp-config.php file that says define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 10 * 1024 );
Change 10 * 1024 to whatever integer you’d like.
thanks, i will try that. 1024 being 1 MB , correct?
Yup, that’s right. BTW putting it in wp-config.php means that it won’t get overwritten when you upgrade BP or WP. Generally, wherever you see a constant in the code (with a CAPITAL_LETTER_NAME like that), you can do something similar to override the defaults in a future-proof way.
I tried uploading a 5mb and a 250kb file with that parameter, didnt work. Anyone know where BP_AVATAR_ORIGINAL_MAX_FILESIZE is defined in the PHP files?
It’s defined in bp-core/bp-core-avatars.php, around line 34. But you’ll see that it shouldn’t be defining it there if you’ve already defined it in wp-config.php
thanks I’ll try changing it there.
Defining it in wp-config didnt help obviously. i also tried define(‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, ‘10240’); to no avail.
Ok it says this
if ( !defined( ‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’ ) ) {
if ( !$bp->site_options )
define( ‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, 5120000 ); /* 5mb */
else
define( ‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, $bp->site_options * 1024 );
}
So the integer you gave me was wrong haha.. its in bytes
So I think its this line that’s screwing it up: define( ‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, $bp->site_options * 1024 );
oops, I might have given you the wrong number.
But you’re wrong that that line is screwing it up. wp-config.php is loaded before this file. So if you’ve defined the constant there, it’ll never get past the first conditional in the code you just pasted.
Omfg ITS WORK!!!
define(‘BP_AVATAR_ORIGINAL_MAX_FILESIZE’, 5120000);
in wp-config
Cheers man!
But why was i the only one with this problem? very strange… All the other guys with this problem had a server side issue.
5MB for an avatar pic is pretty big. Maybe that’s the problem.
So why didnt you guys get it, was your buddypress configured differently? I mean I havent even tweaked the settings of BP
TBH you should be addressing the file itself if it is 5MB as 5MB for a web graphic is not simply ‘pretty big’ it’s far too big! I would be editing the file and compressing before attempting to upload. An avatar for web display is generally around 80px x 80px even if you double that size and whether you are talking gifs or jpgs a file of those dimensions at a web resolution of 72dpi should come out at around ~10k even a large jpg image at say 600px shouldn’t really exceed the ~50k mark and you would have 100 of those for your 5MB.
Uploading large files unnecessarily just drains data transfer, soaks up bandwidth and asks the server to have do do more work in compressing and resizing the image than it need do.
Ok as I said , I didnt even tweak the settings of BP, it came 5MB by default. And as you see it’s linked to Album+ for some strange, and stupid? reason. So if I were to make this smaller, there goes my upload size limit, Lol.
Does anyone know how to change the upload size for BP Group Documents? I’m trying to upload a 3.6 MB file.