[buddypress-trac] [BuddyPress Trac] #6708: Cannot upload group or member photos/avatars

buddypress-trac noreply at wordpress.org
Tue Nov 10 16:54:23 UTC 2015


#6708: Cannot upload group or member photos/avatars
--------------------------------+------------------------------
 Reporter:  Plucker             |       Owner:
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Component - Groups  |     Version:  2.3.3
 Severity:  normal              |  Resolution:
 Keywords:                      |
--------------------------------+------------------------------

Comment (by imath):

 yes you're right. i was just confirming.

 So copy could fail if the directory doesn't exist at the time you try to
 copy it. What is the result of this:

 {{{

 function destination_dir_exists( $file ) {
         $uploads = wp_upload_dir();

         $dirs = array(
                 $uploads['path'] => 0,
                 dirname( $uploads['path'] ) => 0,
                 dirname( dirname( $uploads['path'] ) ) => 0
         );

         foreach ( $dirs as $d => $v ) {
                 $stat   = stat( $d );
                 $rights = $stat['mode'] & 0007777;
                 $dirs[ $d ] = '<br/>' . $d . ' : ' .$rights;
         }

         wp_die( sprintf( '%s is %san existing dir and rights are: %s',
 $uploads['path'], is_dir( $uploads['path'] ) ? '' : 'not', join( ',',
 $dirs ) ) );
 }
 add_filter( 'bp_avatar_upload_prefilter', 'destination_dir_exists', 10, 1
 );

 }}}

 wp_upload_dir should create the different directories automatically if
 uploads belongs to www user and www user has correct rights on it.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6708#comment:28>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list