We are trying to have SharePoint limit the size of the profile picture that can be submitted (to about less than 1MB). This is for the MySite profile picture only.

Can this be done? Either via: 1. an event handler that checks the size of the file the user is trying to submit? 2. an event receiver anywhere inside sharepoint?

thanks for any help.


Assuming you use SharePoint 2010 this really is a non-issue:

When the user uploads the picture using the GUI, SharePoint generates 3 thumbnails with a max with/height (depending on portrait or landscape) of 144px (actually 104px if picture is square), 96px and 32 px.

The thumbnail pictures are saved in the User Photos library in MySite host site, and used for different previews around the site.

Hence the original picture is not used at all.

If you instead use PowerShell to add pictures directly to the AD and import them, the cmdlet wont accept pictures larger than approximately 10KB (the AD field can actually hold pictures up to 100KB). After synchronizing you need to run the cmdlet Update-SPUserPhotoStore to convert the images temporarily stored on MySite host to the above mentioned thumbnails.

PS: when all the above is said, a picture of 1 MB is way way too much for a small profile picture!

| improve this answer | |
  • Thanks for the answer. However, we are getting some mysteriously large medium thumbnails in the process you mention above. When I submit a file up to just under 5mb, I get a medium thumbnail of 2.6k. however some users are showing medium thumbs of around 27k and we can't figure out how they are getting them in there that large. any ideas? – Robert Jul 24 '12 at 16:54
  • The file size is to a large extent related to how hard the image can be compressed. So if it's an image with lots of colours, and differing colours it will be a bit larger. I don't think a size of 27k is something to worry about? We are not talking megabytes here – Robert Lindgren Mar 27 '13 at 10:25
  • 27K sounds ok, but 5 mb is very big. Consider uploading pictures with a lower resolution or use a photo tool to reduce size (just doing a 90% JPG image will reduce size from MB's to KB's) – Anders Rask Mar 27 '13 at 11:47

Are the dimmensions different than what they should be or is it just a file size issue?

Here's a brief overview of how the Photo management works in 2010: http://iedaddy.com/2010/12/sharepoint-2010photo-management-for-social-mysites/

you're only supposed to get three sizes, of 144/96/32. So what happens when you run this PowerShell command?

Update-SPProfilePhotoStore -MySiteHostLocation http://

Are your dimensions corrected?

| improve this answer | |

The maximum size is hardcoded to 5000000 bytes in SharePoint and the size is validated on the OK button on the Upload Picture ajax window. You can find this in the class Microsoft.SharePoint.Portal.WebControls.ProfileImagePicker.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.