• Resolved yzqiang

    (@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);
    fclose($input);
    
    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.

    https://www.ads-software.com/plugins/buddypress-activity-plus/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter yzqiang

    (@yzqiang)

    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?

    Thread Starter yzqiang

    (@yzqiang)

    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?

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @yzqiang,

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

    define('WP_DEBUG',true);
    define('WP_DEBUG_LOG',true);

    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:

    @ini_set('display_errors',0);
    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 wpmu.org 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,

    Thread Starter yzqiang

    (@yzqiang)

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

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @yzqiang,

    Please advise if you found anything in the log file.

    Regards,

    Thread Starter yzqiang

    (@yzqiang)

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

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @yzqiang,

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

    define('WP_DEBUG_LOG',true);

    Where are you finding it?

    It should be on the following path

    wp-content/debug.log

    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.

    https://wordpress.stackexchange.com/a/84269/14347

    Regards,

    Thread Starter yzqiang

    (@yzqiang)

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

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @yzqiang,

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

    Please advise if you need any help.

    Cheers,

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