Select a picture from the device

Hi there,

how can one select a picture from the device library. E.g., I use an iPhone and would like to select a picture from the Photo app and upload the picture into my app.

Thank you and best regards

Hello @Joerg_Refeld

Please read this documentation. It describes the methods you should use to upload files.
https://backendless.com/docs/ios/files_file_upload.html

Also, you can download a ready-made solution for the SDK you need in the Code Generation section.

Regards,
Inna

Hello Inna,

thank you for the prompt response and the solutions. Not sure if I didn’t express myself in sufficient detail. E.g.,to add a picture on a profile page I was looking for this kind of workflow:

  • click a button in my app
  • the pictures on my device are shown
  • I select one
  • it gets uploaded into my app (and is the new profile picture)

Is that possible? And if, how?

Alternatively, can I take a picture from within the app?

With the solution you suggested a few additional are necessary to add a picture to the profile page.

Thank you and best regards

Please clarify, you specified UI-builder in the topic name. Are you going to make your application using UI-builder?

1 Like

Same question. How to add a profile picture using UI-builder?

1 Like

UI Builder provides a File Upload Button component.
Regards

1 Like

You can download an image with logic where you generate a name for this file. After that save a some information in the developer’s info(path for example or boolean “hasImage” = true). And add some logic to the developer’s profile. If “hasImage” from developer data = true - use some path for image, if no - use placeholder.

Regards, DIma.

Path means only the name of the folder with the file name like “images/photo.jpg” not the full path that was my problem. Solved and running!

hie am working on this and i don’t understand how you mean. Please help.

@Dalubuhle_Lunga Need help uploading files to UI Builder?

I have figured out how to use the upload button. However, i have an image avatar, i want the profile picture to be uploaded through clicking on that avarta and having a pop up like the one when you have the file uploader button…

  1. Instead of uploading through the button is it possible to make my image avatar behave like the button.
    or
  2. is it possible to customise the button and make it have a default avatar that can change when the uses pics a different image for their profile.?

You can change the button in less/css

Example:

.ButtonUpload.bl-button.bl-button--contained:not(.bl-button--disabled) {
  background-image: url('https://biblioteka.floranova.in.ua/wp-content/uploads/2019/04/56bf41f84eecb-600x600.jpg');
}

Thanks alot V

Feb 2023: it doesn’t seem possible to assign style: background-image to buttons anymore?!

Works for me:
Preview:
https://starnote.backendless.app/api/files/ui-builder/containers/default/index.html?page=test

Design-time:

Extension:

Ah, the !important did the trick… thnx :slight_smile: