• Hi I’m running buddypress on my local xampp server and when I try to upload an image using the Activity Plus plugin I get an error. It says “could not save uploaded file. The upload was canceled, or server error encountered.”

    I’ve tried changing permissions to read and write on the htdocs folder and subfolders but it still wont work. Regular avatar images will upload but not images uploaded using Activity plus.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello mattmattmatt23,

    I just test BuddyPress activity on my local xampp and I could upload files without problem.
    Are you using uploading from computer or from external link? Both options are working for me without a problem.
    Have you run plugin conflict test? If no, can you do that? let me know how it goes.

    kind regards,
    Kasia

    Thread Starter mattmattmatt23

    (@mattmattmatt23)

    Im uploading from my computer. I will try a plugin test and post an update

    Thread Starter mattmattmatt23

    (@mattmattmatt23)

    I deactivated all my plugins except for buddypress and activity plus. I still am having the error. I also activated the default 2017 them and tried but it is still giving me an error.

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @mattmattmatt23,

    I’m not sure on what system you are now, but can you try this
    1) Ubuntu

    Do (prepend with sudo if you’re not the current owner and need to elevate your own permissions in order to do it):

    chown www-data /path/to/directory

    to make www-data the owner which makes it writeable usually, or another approach via groups:

    chgrp www-data /path/to/directory
    chmod g+w /path/to/directory

    b) Windows / Mac

    Reset the ownership of the WordPress instillation to nobody. You can do this by running the a command in the command line/terminal.

    Windows System: Start -> Programs -> Accessories -> Command Prompt
    Mac: Applications ->Utilities -> Terminal
    The command you need to run is the following (change “wp” to the actual directory name in your installation):
    sudo chown -R nobody:staff /applications/xampp/xamppfiles/htdocs/wp

    kind regards,
    Kasia

    Thread Starter mattmattmatt23

    (@mattmattmatt23)

    I used the command in the terminal. Im on a mac but I’m still getting the same error when uploading an image

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @mattmattmatt23,

    Okey, lets try something else. Please enable debug log in your WordPress and try uploading again. Let see what error will show there.

    To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:
    define('WP_DEBUG', true);
    In order to enable the error logging to a file on the server you need to add yet one more similar line:

    define( 'WP_DEBUG_LOG', true );

    In this case the errors will be saved to a debug.log log file inside the /wp-content/directory.

    Depending on whether you want your errors to be only logged or also displayed on the screen you should also have this line there, immediately after the line mentioned above:

    define( 'WP_DEBUG_DISPLAY', false );

    The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it.

    I would need then to see content of the debug.log file – so please upload it to service like a Dropbox and paste link here.

    kind regards
    Kasia

    Thread Starter mattmattmatt23

    (@mattmattmatt23)

    I’m getting two errors in the log file

    The first doesn’t seem to be affecting the image upload. I don’t know what to make of them.

    [17-Jul-2017 15:03:33 UTC] PHP Notice: Object of class WP_Post could not be converted to int in /Applications/XAMPP/xamppfiles/htdocs/wordpress2/wp-includes/general-template.php on line 1030

    [17-Jul-2017 15:04:39 UTC] PHP Warning: stream_copy_to_stream() expects parameter 2 to be resource, boolean given in /Applications/XAMPP/xamppfiles/htdocs/wordpress2/wp-content/plugins/buddypress-activity-plus/lib/external/file_uploader.php on line 14

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @mattmattmatt23,

    It seems that your /tmp directory is not writable
    https://user-meta.com/forums/topic/upload-avatarfile-failed/#post-1379

    Check if tmp directory permissions are the same as described here https://superuser.com/a/753861

    kind regards,
    Kasia

    Thread Starter mattmattmatt23

    (@mattmattmatt23)

    When I check the permissions in the terminal they come back as writeable

    ls -ld@ /private/tmp
    drwxrwxrwt 7 root wheel 238 23 Jul 22:28 /private/tmp

    If I try to change them with sudo command it wont allow it.

    Will I have this problem when I migrate my site to a live server? Will I have to change permissions with a commercial host?

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @mattmattmatt23,

    Will I have this problem when I migrate my site to a live server? Will I have to change permissions with a commercial host?

    It is very highly unlike that you will need to change anything on live hosting. In cases like that, when there is problem with permission then hosting provider is able to set them correctly, so you don’t need to change anything.

    I’m running this plugin also on live server and I’m not able to replicate issue.

    kind regards,
    Kasia

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘image upload failed’ is closed to new replies.