How do you get the Profile Picture URL through code?
-
How do you get the user profile picture from an SPUser profile?
-
Answer:
You can look at the User Information List, to grab the Picture column contents. It's a hidden field, so you might have to write a console app to get the columns, or find a reference somewhere online. Tobias Zimmergren did a blog post on getting user data from the User Information List from an SPUser object: http://www.zimmergren.net/archive/2008/06/25/sharepoints-hidden-user-list-user-information-list.aspx
Burt at SharePoint Visit the source
Other answers
You can do something like this: public string GetUserPicture(SPSite site) { string userAccount = "domain\\account"; ServerContext ctx = ServerContext.GetContext(site); UserProfileManager upm = new UserProfileManager(ctx); UserProfile up = upm.GetUserProfile(userAccount); return up["PictureUrl"].Value; }
tarjeieo
do you need some kind of permissions to get the pictures of other users than yourself? I only get my own picture.
Gene Vangampelaere
Related Q & A:
- How to get yahoo profile picture?Best solution by Yahoo! Answers
- How do i change my profile picture?Best solution by Meta Stack Overflow
- How do you get an animated picture on your profile?Best solution by Yahoo! Answers
- How can I get a profile picture?Best solution by Yahoo! Answers
- How do you get animated profile picture?Best solution by scratch.mit.edu
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.