Change Upload Path

hiya,

How can I change default upload path?

I want to save avatars for blog id,
For example:when I use this code,

global $wpdb;
if($wpdb->blogid < 4){
$avatars_path = 'wp-content/uploads/avatars/assets00';
}else
{
$avatars_path = 'wp-content/uploads/avatars/assets01';
}

avatars upload correct sequences.But not seems correctly.

Any idea?

Thanks.