MyBB Community Forums

Full Version: Problem uploading attachment that dissapears
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings Everyone:

I am the administrator of https://tradingfuturo.com/forum and I have an issue after upgrading from 1.8.14 to 1.8.19. I upgraded with each diff file 5 times and corresponding database upgrade with the script. Now after fixing the logging in issue by fixing the theme, I still have another disturbing issue.

Everytime I try to upload a file to the board or to edit a post and add an attachment the uploaded file just dissapears with no error. Nothing in the logs. Upload folder was chmod 777. I increased upload size and post size too. But happens with any file even tiny one.

I tried changing the theme. Setting another one recently updated and also switching to the default one. Nothing. Server hardrive has space. I also turned showing php error displays on just to maybe detect something and nothing. No error no nothing, just swallows the file.

Maybe somebody here can help me out since this is turning into a nightmare. I even checked the php files to spot something maybe.

I am running the forum behind cloudflare.

Regards
Firstly, have you tried disabling cloudflare (you can pause it temporarily). Its unlikely its cuasing an issue but its always best to ensure the issue is actually on your end and not CF.

If uploads don't work on the default theme that is curious. You get no errors in the PHP Error log?
Hi. Thanks for your reply. I disabled cloudflare (switched to development mode) and got the same. I only get this error in mybb error log from time to time that looks normal given the traffic.

SQL Error: 2006 - MySQL server has gone away

I even restarted mysql and yesterday the server entirely and exactly same behaviour

Whatever the error mybb is totally mute. I did a backup of the databse and verified/optimized tables and all went ok.

I tried this permissions clearly excessive but still:

https://docs.mybb.com/1.8/install/#file-permissions

Also increased minimal operating system file count. Nothing.

I was tracking down this getting my hands dirty after trying deisabling plugins. And I located a series of problems:

First in this file:

https://github.com/mybb/mybb/blob/featur...upload.php

The function:

function add_attachments($pid, $forumpermissions, $attachwhere, $action=false)

looks quite deficient and buggy. It's error reporting is quite bad. Should complaint when some of the things fail but it silently ignores the errors. Very badly programmed.

I made some amendments checking for $total == 0 that is what was happening and realized the error was reported but not displayed.

I then realized the form was sending "attachment" instead of "attachments" (notice the ending S) so I wen ahead and fixed the template to change the name to "attachments".

But then some other error is happening after the fix. Of course no error is displayed for whatever reason.

Any Idea on why this error is not displayed only showing an empty alert when this variable is populated:

$ret['errors'][] = ...

Maybe I could track down this further.