[SOLVED] Create Backoffice User with Avatar
# help-with-umbraco
o
I'm migrating user information from another platform into Umbraco. I can create the users programmatically but I can´t findo information about how to set the "Avatar" field. If we do it via the BO UI, the avatar name is saved under the avatar field in the user table, but I don't know where is the image. Anyone with this requirement before?
Anyone knows where exacly the user avatars is getting saved? I'm a little bit confused 😅
k
i think it gets saved in the media folders ?
wwwroot/media/UserAvatars
o
I didn’t find it there
k
That's where it is if the user has uploaded a photo, if they haven't it gets the picture from a gravatar API I think
back from a walk so that means the image isn't stored for most users its got from a URL https://gravatar.com/site/implement/hash/
o
Amazing. I've found it. So I've to upload it "manualy" to this folder instead of creating a new media item
k
yes - its in the media file system but its not in the media database (if that makes sense) there are still media services you should use, because the media files might not always be on the physical disk (they might be in azure for example). So with the media file service you can save a stream into the "media" folder e.g
Copy code
cs
mediaService.SetMediaFileContent(relativePath, stream);
i think relativePath will be something like "/media/UserAvatars/file.png"
o
@Kevin Jump thank you very much. It was really helpful
6 Views