Skip to content

Get the Avatar in GoLang+HTMX #4953

Answered by ganigeorgiev
OfflinePing asked this question in Q&A
Discussion options

You must be logged in to vote

FindFileFieldByFile returns the file schema field associated with the file, not the file itself.

If you want a url to the avatar file you'll have to construct it on your own (see File URL). One possible example could be:

filename := user.GetString("avatar")
avatar := app.Settings().Meta.AppUrl + "/api/files/" + user.Collection().Id + "/" + user.Id + "/" + filename

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by OfflinePing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants