This code:public static string GetUserAvatar(string UserName){MembershipService service = new MembershipService("MySiteURL", "Me", "MyKey");return service.GetUser(UserName).AvatarUrl;}Run with my name returns this: http://community.mysite.com/api/membership.ashx/users/2100/avatarHow do I use that to get the path to the file so I can display in my image tag?
http://community.metalreview.com/forums
There is currently an issue with the avatar handling that will be fixed in SP1. The avatar support was added to the REST API before the avatars were moved into the new CFS storage framework, and the REST API wasn't updated to the new method.
If you go to the URL returned by AvatarUrl, it will return a 301 redirect to the actual avatar URL (though the URL that it returns is where the issue is). In the SP1 client API, we will have a method on the MembershipService for getting the attachments that you'd be able to use.
Ahhh... ok, thanks.
Ken Robertson: There is currently an issue with the avatar handling that will be fixed in SP1. The avatar support was added to the REST API before the avatars were moved into the new CFS storage framework, and the REST API wasn't updated to the new method. If you go to the URL returned by AvatarUrl, it will return a 301 redirect to the actual avatar URL (though the URL that it returns is where the issue is). In the SP1 client API, we will have a method on the MembershipService for getting the attachments that you'd be able to use.
Isn't it the CommunityServer.WebServices.dll file included in the /bin/ of the CS2008 upgrade files?
CS Documentation | Nintendo Wiikly
afscrome: Isn't it the CommunityServer.WebServices.dll file included in the /bin/ of the CS2008 upgrade files?
Looks like the last one was updated in April?
The one included in hte CS2008 SP1 download is a newer version than the April one from api.communityserver.org. The SP1 dll is version 4.0.30610.12572
The question is...... is this avatar issue fixed in this new version? I will try my code.
Im using the latest dll's (from SP1) but it still returns the http://host.com/api/membership.ashx/users/2102/avatar. That should work fine, but it redirects the user to http://host.com~/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.02/avatar.jpg. Somehow this api-call doesn't use the ResolveUrl to get construct this Uri. Unfortunatly, if a user uploads a picture, you'll get the ~/cfs-file.ashx/__key/CommunityServer.Components.Avatars/00.00.00.21.02/avatar.jpg link as avatar, including the ~. If you remove the ~ from the userprofile it works fine. Looks like a bug to me...
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com