WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress Activity Plus
[resolved] Unable to upload images (10 posts)

  1. yzqiang
    Member
    Posted 6 months ago #

    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.

    http://wordpress.org/plugins/buddypress-activity-plus/

  2. yzqiang
    Member
    Posted 6 months ago #

    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?

  3. yzqiang
    Member
    Posted 6 months ago #

    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?

  4. WPMU DEV
    Member
    Posted 6 months ago #

    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,

  5. yzqiang
    Member
    Posted 6 months ago #

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

  6. WPMU DEV
    Member
    Posted 6 months ago #

    Hi @yzqiang,

    Please advise if you found anything in the log file.

    Regards,

  7. yzqiang
    Member
    Posted 6 months ago #

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

  8. WPMU DEV
    Member
    Posted 6 months ago #

    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.

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

    Regards,

  9. yzqiang
    Member
    Posted 6 months ago #

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

  10. WPMU DEV
    Member
    Posted 6 months ago #

    Hi @yzqiang,

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

    Please advise if you need any help.

    Cheers,

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.