Not a bug Unable to upload more than 50 attachments

gib

Well-known member
Affected version
v2.2.10
Before upgrading to v.2.2.10, I was able to upload more than 50 image attachments to a thread no problem.

I have checked both the 'ATTACHMENTS option' (Maximum attachments per message) and the 'MESSAGES option' (Maximum images per message), these are both set to zero (no limit)

I have tried running under nginx and apache, but I am still unable to load more than 50 images (see error below) using XF 2.2.10, there are no warnings or errors in the web logs.

I have also increased PHP settings for max_file_uploads to 1000, but I still can't upload more than 50 files.
I think it used to give a different message if uploading about the file limits in the admin options.
1658592850029.png
I reverted my site to a previous v2.2.9 instance and it uploads more than 50 images no problem, so it looks like something different is happing with v 2.2.10
I also tried the recent 2.2.10 patch and it does the same.

As a test, I resized some small jpg photos and renamed them in a sequence of 60 photos, but it fails on 51st upload in the same image.

I am running on PHP v8.1.8
 
2.2.10 has a new feature that limits a user's unassociated attachments to 100 by default (basically that means 100 attachments in the last 24 hours on a post or other content that hasn't been submitted).

You can raise the limit with this in your config.php file:

PHP:
$config['unassociatedAttachmentLimit'] = 500;

You can set the number to whatever you want it to be.
 
2.2.10 has a new feature that limits a user's unassociated attachments to 100 by default (basically that means 100 attachments in the last 24 hours on a post or other content that hasn't been submitted).

You can raise the limit with this in your config.php file:

PHP:
$config['unassociatedAttachmentLimit'] = 500;

You can set the number to whatever you want it to be.

Ahh, nice one @digitalpoint , I added that to my config file and I can upload images again, thank you very much !
 
I guess XF must be treating the uploaded images as unassociated during upload until it inserts them into the post
 
I guess XF must be treating the uploaded images as unassociated until it inserts them into the post
Yep, that's exactly what it's doing. You can't associate an attachment to a post that doesn't exist in the database yet. They get associated when you submit the post (after the post is created).
 
2.2.10 has a new feature that limits a user's unassociated attachments to 100 by default (basically that means 100 attachments in the last 24 hours on a post or other content that hasn't been submitted).

You can raise the limit with this in your config.php file:

PHP:
$config['unassociatedAttachmentLimit'] = 500;

You can set the number to whatever you want it to be.
Hello,

Thanks a lot for the tips.

I entered 5,000 here by modifying the code to
Code:
$config['unassociatedAttachmentLimit'] = 5000;
but it seems to have picked 500 instead. Is there a hard limit on how far the value can go? Like is it supposed to recognize a 50,000 value?

Lastly, is there any way to entirely remove the restriction or set it to unlimited instead?
 
but it seems to have picked 500 instead. Is there a hard limit on how far the value can go? Like is it supposed to recognize a 50,000 value?

Lastly, is there any way to entirely remove the restriction or set it to unlimited instead?
I certainly HOPE there is a hard limit.... otherwise, that would be a wonderful attack vector to bring a site down.
 
Hello,

Thanks a lot for the tips.

I entered 5,000 here by modifying the code to
Code:
$config['unassociatedAttachmentLimit'] = 5000;
but it seems to have picked 500 instead. Is there a hard limit on how far the value can go? Like is it supposed to recognize a 50,000 value?

Lastly, is there any way to entirely remove the restriction or set it to unlimited instead?
There is no hard limit .. you need to check attachmentMaxPerMessage setting
 
Top Bottom