Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Uploading images to the cloud with BaaS in RAD Studio XE6

In Delphi, C++Builder and RAD Studio XE6, we integrate with leading Backend as a Service (BaaS) providers to add functionality and platform services to your applications. With BaaS, you get easy access to common services in the cloud without having to build or maintain the backend services yourself. This includes support for being able to upload images to your BaaS account using RAD Studio XE6.

Today, I thought I would create a demo that shows you how to load an image from the gallery, upload it to your Parse.com account (you will need to sign up for an account), display the image URL in an Edit control and then download the uploaded image and display it in your app.

I used the following BaaS components:

I wanted to be able to select images from the photo album on my device using either the ‘Access Gallery’ button or by clicking on the TImage. I used the built-in action (TActionList) for accessing an image from the library and then executed that action again on button click. In addition, the URL of my image location is assigned to an Edit control after I upload the image to Parse. I also set up an on-click event to download the image using the provided URL and then assign it to a TImage.

The user interface of my application consists of a toolbar with a parented TLabel for the title, a TListbox with several listbox items and two TListbox Groupheaders for displaying the titles.

Here is the Object Pascal Code for my application:

[crayon-6768e94242653028386025/]

Note: This requires XE6 Update 1 to be installed.

Exit mobile version