Support Topics Documentation Slack YouTube Blog

Get User Profile Pictures

Hey everyone,

We are working on our app using Unity, we want to get the user’s profile pictures into our database {Users}, could you please explain how to do that?

Hi Hassan,

First of all, welcome to the community!

Do you need to upload the pictures using the API or manually?

Regards,
Mark

1 Like

API of course.
When the users upload their pictures, I want these pics to be on my database using API.

The recommended approach goes like this:

  1. Upload the file using the File Upload API. The API returns the file URL.
  2. Use the file URL returned from (1) and set it as a property of the user object, for example the profileURL property, so that when the user object is saved in the database, the profileURL will contain a string value which is the URL
  3. When user logs in and you get the BackendlessUser object, it will contain the profileURL property and you can fetch the file.

Hope this helps.

Regards,
Mark

In this case, what if the user uploaded an image then an error happened in the registration ( the uploaded image doesn’t have an user)?

In this case you can delete the file using this API:
https://backendless.com/docs/dotnet/files_file_deletion.html

Thank you that helped me.
I may ask again for some problems!

Thanks again!!