MyBB Community Forums

Full Version: Problems uploading image files to forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
I've been running MyBB v1.8.9 with no plugins and just one theme (FunkyOne).  I cannot reliably upload file attachments.  Sometimes it works, sometimes not.  Most times I just get a blank white page with no error message after clicking add attachment.  The result is the same whether I add via a URL or via the add attachment button.  It also does the same thing from the Admin back end.

I found the blank page would come up when I made an expected mistake like trying to add an avatar that was too big for example.  If I resized the avatar, then the upload would often then work with no issue - usually.

Yesterday, I tried to add a jpg image attachment to a thread that was 130 kb in size - under the 500 kb limit.  Result was blank white page.  I then resized the image to 120 kb and it worked ok.  It seems completely random.

It would be far better if I at least got an error message stating what the problem was but I get nothing.

I spent quite a bit of time with Tech Support at my hosting company One.com to see if the problem was their end but everything was fine as far as they were concerned.  It's not a theme issue so there must be something going on with MyBB.

I have a very fast and reliable fibre connection on a fast up to date Windows 10 pc so it's not that.  I get the same behaviour in different browsers - Chrome or Firefox for example.

Has anyone else experienced this?  This is doing my head in as I can't launch my forum until I know what is going on and can make it reliable.
It sounds like is a server issue of some sort - if it's an error MyBB can handle (failed upload) it will handle it, blank screens when uploading are usually due to the server not being able to process the request so the script has just died.

Can you check your server error logs to see if it says anything about it?

Create a folder in your web root called upload_test, CHMOD it to 777, then create a file called upload_test.php and put this in it:

<form method="post" enctype="multipart/form-data">
    <input type="file" name="file" />
    <input type="submit" name="submit" />
</form>
<?php
if(!empty($_POST) && isset($_POST['submit']))
{
    move_uploaded_file($_FILES["file"]["tmp_name"], 'upload_test/'.basename($_FILES["file"]["name"]));
    echo 'Done :)';
}

Visit the file in your browser, try and upload some files, and see what happens.
Hi Matt,

Tried that and the attempted file load resulted in an error that said:

<removed full file path>

Not sure what that means but it doesn't look good..
I think you've put upload_test.php inside the upload_test folder, both need to be in the web root (so ./upload_test/ and ./upload_test.php are on the same level). Move upload_test.php up a level and try again.
Ah ok.

Ok. No error messages this time. The upload finished with the message Done. The uploaded file has ended up in the upload_test folder. If I try to add via a forum thread I get the blank page as usual.

One.com have just come back to me and suggested downgrading to php v5.6 from v7.1.

Just noticed if I look in the uploads folder for January 2017 I can see lots of entries there with the file name 'post_1_' followed by a long alphanumeric code and the file type 'ATTACH File', each with the correct file size. Each of these represents every attempt that I made to attach the image file. So something is stopping the process but is recording at least some sort of file. Does this mean anything to you Matt?

I downgraded to php 5.6 but it made no difference. Still getting the blank pages.
Hm, were you able to check the error logs to see if there's anything in there?
Where should I be looking for the error logs Matt?
Do you have cPanel or any other sort of control panel provided by your hosting? They should be in there somewhere. Or, if configured, you may have a file called error.log in your web root which may contain something useful. If there's content in either location but you cna't see anything obvious, PM the contents to me and I'll see if I can see anything.

If not, it may be a case of PMing me FTP login details so I can debug the process as it happens on your forum and try and find where it stops.
Ok. Will see what I can find.

No logs anywhere unfortunately. What sort of login do you need Matt?
Just a normal FTP login to access your file system will be fine, and if you could send me your URL with a test account (normal user is fine) so I can test uploading.
Pages: 1 2 3 4