Support » Plugin: BuddyPress Activity Plus » Unable to upload images

  • Resolved yzqiang


    Environment: Mac 10.9+MAMP 2.2+WordPress 3.8+Buddypress 1.9+Buddypress Activity Plus 1.4
    One week ago, Buddypress Activity Plus plugin works fine. But from today, any images can’t be uploaded. Error message shows below:

    Could not save uploaded file.The upload was cancelled, or server error encountered

    I think it should be directory permission issue, but 755 or 777 don’t work neither.
    I think it should be HTTP Server issue, but after change to XAMPP, it still doesn’t work.
    I trace the code, I believe the error happens in the file file_uploader.php and function save.

    $input = fopen("php://input", "r");
    $temp = tmpfile();
    $realSize = stream_copy_to_stream($input, $temp);
    if ($realSize != $this->getSize()){
        return false;

    I think there are 2 possible reasons:
    1. tmpfile function can’t return a permissible directory.
    2. Something wrong to make stream_copy_to_stream function doesn’t work.
    These possible reasons make realSize != $this->getSize() happen.
    Anyone can help me?
    Thanks a lot.

Viewing 9 replies - 1 through 9 (of 9 total)
  • By the way, I tried BuddyPress Activity Plus 1.5, the problem is same.
    Is it possible that Mac OS X change the directory permission policy?

    After rebooting the machine, the problem disappear. However, when I reboot the MAMP, the proble appear again. It’s so weird.
    Anyone can tell me why it happens?

    Hi @yzqiang,

    Can you please try enabling WP_DEBUG mode and debug logging? To do this, just go to wp-config.php include this:


    You might already have a line for WP_DEBUG, so just make sure it’s set to true. This will create a log file under wp-content/debug.log with detailed information.

    If you’d like to avoid end users seeing error messages, you can include this as well:

    define('WP_DEBUG_DISPLAY', false);

    This will prevent errors from being displayed, but you can still find them in the log file. For information on this, checkout this article.

    Also check the javascript console for errors. In Chrome go to “View -> Developer -> Javascript Console” and in Firefox you can go to “Tools -> Web Developer -> Consoleā€

    Let me know what errors if any you are getting so that i can troubleshoot it.

    Best Regards,

    I have added the code already. I will see the log file and send it to you if there is something available.

    Hi @yzqiang,

    Please advise if you found anything in the log file.


    It’s weird the log file wasn’t generated even after my modification of config file. I don’t know wny.

    Hi @yzqiang,

    Have you added following line in wp-config.php file?


    Where are you finding it?

    It should be on the following path


    Does the wp-content folder have proper file permissions?

    You can also change the log file location using the answer provided on the following link.


    The log has been generated successfully. I will research on it first.

    Hi @yzqiang,

    That’s good that you are taking initiative to resolve this issue.

    Please advise if you need any help.


Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Unable to upload images’ is closed to new replies.