Notifications
Clear all

Script [Solved] Avatar Image Too Big Maximum Allowed Size is 2MB

13 Posts
6 Users
0 Likes
4,327 Views
Posts: 6
Topic starter
(@colbytech)
Active Member
Joined: 5 years ago

I don't know why, I have a couple of users that are trying to upload avatars into the system that are larger than 2MB.  I am wondering why they can't do this?  My site is set to an 8MB maximum upload size; however, it seems that avatars don't follow this parameter.  I have done searches and cannot find an answer for avatar file size.

Any clue on this?  WPForo must be reading the limitation from somewhere, it gives the error as a pop-up on the top right (like a subscription of other notification from the forum).

12 Replies
Sofy
Posts: 4053
 Sofy
(@sofy)
Famed Member
Joined: 6 years ago

Hi @colbytech,

Please let us know the server "post_max_size" value.  You can find it in Dashboard > Forums > Settings > Topics & Posts Tab.

 

Reply
Posts: 6
Topic starter
(@colbytech)
Active Member
Joined: 5 years ago

It is 8MB.

Reply
Posts: 6
Topic starter
(@colbytech)
Active Member
Joined: 5 years ago

Just wondering if there has been any resolution to this?

Reply
Sofy
Posts: 4053
 Sofy
(@sofy)
Famed Member
Joined: 6 years ago

Hi @colbytech,

Sorry for the delay. 

We'll add a new filter wpforo_avatar_upload_max_filesize in next version release. You'll be able to change the avatar upload size, and set it as you like. For now, wpForo doesn't allow to upload the images bigger than 2MB. Please wait for the next update. 

Reply
8 Replies
(@bertrand)
Joined: 3 years ago

New Member
Posts: 1

Hi,

I'm new here but interested in the max. size avatar image upload matter. Some of my uers have had problems trying to upload their image. Has anything been done in the last 3 years ? I can't find anything on my back end panel...

Thank you,

B.

Reply
Robert
Admin
(@robert)
Joined: 8 years ago

Support Team
Posts: 10287

@bertrand,

Yes, the hook had been added. You can use it and increase the max avatar size using the hook code below. Put it in the functions.php file of your current active WordPress theme or install the Code Snippets plugin and insert the code as a new code snippet. It'll increase the max avatar size to 5MB, you can change it in the code:

add_filter('wpforo_avatar_upload_max_filesize', function ($size){
return (5*1048576); //5MB
});
Reply
(@walehub)
Joined: 2 years ago

Eminent Member
Posts: 12

@robert It didn't work. The error is the attached screenshot.

Reply
Chris
(@chris)
Joined: 2 years ago

Famed Member
Posts: 3652

@walehub,

The issue comes that You hadn't added the code properly, or made changes in the PHP file.

Reply
(@walehub)
Joined: 2 years ago

Eminent Member
Posts: 12

@chris How do I properly add it? I copied and pasted exactly as it was there

Reply
Chris
(@chris)
Joined: 2 years ago

Famed Member
Posts: 3652

@walehub,

I have checked the hook, and it works correct, in the screenshot you provided is written syntax error, which means that there is a missing symbol, wrong symbol, wrong name etc. but not the hook which Robert has provided. The hook works correct.

 

Reply
(@walehub)
Joined: 2 years ago

Eminent Member
Posts: 12

@chris thank you..

By the way, where do the uploaded avatars go? I can't find it in attachments. In case I want to delete some avatars, I don't see a way to do that.

Reply
Chris
(@chris)
Joined: 2 years ago

Famed Member
Posts: 3652

@walehub,

This is the Avatar path: /wp-content/uploads/wpforo/avatars/

Reply