XF 2.2 How to avoid this error? "You have reached the maximum limit for attachment uploads. Please try again later."

rdn

Well-known member
What specific XenForo option or User-Group permission to adjust?
Even a single file upload triggers that error.
 

Chris D

XenForo developer
Staff member
There is a specific reason this is happening and it is new in XF 2.2.10. Just need to ask a few questions to establish it is working okay before I explain what it is and how to adjust it.

Who exactly is hitting this issue? Is it happening to all users or just specific users?
 

Chris D

XenForo developer
Staff member
Also if you run this query, replacing XXX with that user's user ID, what count is returned?

SQL:
SELECT COUNT(*)
FROM xf_attachment AS a
INNER JOIN xf_attachment_data AS ad ON
    (a.data_id = ad.data_id AND ad.user_id = XXX)
WHERE a.unassociated = 1
 

Chris D

XenForo developer
Staff member
Okay.

Just to be clear, this user has a large number of unassociated attachments. They are generally attachments that have been uploaded, but haven't been associated with any content.

For example, if I uploaded a file to this reply, but never posted the reply, the attachment would exist, but it would be unassociated. It becomes associated when the reply is posted.

Would you say it's typical for this user to upload attachments that are never associated? Worth noting that unassociated attachments are usually deleted after 24 hours.
 

rdn

Well-known member
This new optional config works fine for me.
/src/config.php
PHP:
$config['unassociatedAttachmentLimit'] = 300;

Thanks @Chris D .
This kind of changes should be documented on the release notes.
The default limit of 100 maybe too low for some big boards.
 
Last edited:

VBX Co

Active member
So a new bit of code that applies limits to attachments has been added (with an arbitrary limit set by the XF team), which gives a warning to end-users and stops them uploading ... and it isn't mentioned in the release notes?

What is the purpose/use of this new code?
 

digitalpoint

Well-known member
This new optional config works fine for me.
/src/config.php
PHP:
$config['unassociatedAttachmentLimit'] = 300;

Thanks @Chris D .
This kind of changes should be documented on the release notes.
The default limit of 100 maybe too low for some big boards.
Big board or not, why is any user uploading over 100 attachments in a 24 hour period for posts/content they never submit? Seems strange to me. 🤷🏻‍♂️
 

beerForo

Well-known member
I only ask because we've not seen it mentioned and we use an add-on to download hot-linked images as attachments, but if it is now part of the core we'd like to get it set up. (y)
XF has mirroring to the gallery, so not related here.
They also have image proxy which saves the hotlinked image.
 
Top