Dev4Press No Script
Back to GD bbPress Attachments Forum

Logs Unknown file

Published on: November 12, 2026 at 10:35 pm · By: John McLeod
Author
Topic
#579209

Since updating to 5.0, every topic or reply posted without an attachment gets an upload error logged and displayed under the post:

Upload Errors: Unknown file: File not uploaded.

Members who never touched the attachment field are seeing this. If they click “Add another file” and leave both fields empty, two errors are logged. Every single post since upgrading has the error logged.

Steps to reproduce

Version 5.0, with Error logging activated (the default).
Post a topic or reply and leave the attachment field empty.
View the post as the author or an admin: the error is shown, and a _bbp_attachment_upload_error row is added to postmeta.

Cause
In code/front.php, process_attachments() (around line 167), the new handler treats UPLOAD_ERR_NO_FILE as an error:

php
if ( $error == UPLOAD_ERR_NO_FILE ) {
$errors->add( ‘php_upload’, ‘File not uploaded.’, $file_name !== ” ? $file_name : __( ‘Unknown file’, ‘gd-bbpress-attachments’ ) );
continue;
}

Browsers always submit an empty d4p_attachment[] field, and PHP reports it with UPLOAD_ERR_NO_FILE, so this fires on every post with no file selected. Empty slots should be skipped silently, i.e. just continue; without adding an error.

Workaround
I’ve turned off Error logging under Advanced Settings and used the “Clear all logged upload errors” tool. That stops the messages, but it also means genuine upload failures are no longer reported to users.

Environment

forumAttachments for bbPress 5.0 (worked correctly on 4.9.4)
WordPress: 7.1.4
bbPress: 2.6.21
PHP: 8.3
The forums are private/behind login.

Could this be fixed in the next release? Thanks!

Viewing 1 replies (of 1 total)
Author
Replies
Viewing 1 replies (of 1 total)
  • The topic ‘Logs Unknown file’ is closed to new replies.