Appgyver image upload solution

Just wanted to share with appgyver users that posting and retrieving images will not work unless you create an object list to store both the downloadURL and the storageKey. You can do this by creating a column with JSON data type in backendless.

For your reference:

And

After that you can create record. Formula is:

MAP(outputs[“Get bucket download URLs”].files, {downloadUrl: item.downloadUrl, storageKey: item.storageKey})

Hope that helps someone.

3 Likes

Hello, @l_r

Thanks for your information, I believe it will be very helpful for other users.

Did you try to do the same in UIBuiilder?

Regards, Dima

I’ve never tried the UI builder, and dropsource comes with a hefty price tag. So lately, I’ve been testing appgyver for frontend mobile dev (react native), and using backendless as the backend. It seems to be working well.

1 Like

Hi
Thanks @l_r for the information.
It’ll be great if you can post your code (sorry no-code :wink: ). I’m newbie to both AppGyver and Backendless and I’m facing the same issue.
Regards

I deleted my test app due to some issues with uploading images on newer android devices. The issue was unrelated to backendless. Appgyver has a runtime error that they are working through, and resolving in the next update. Older devices still work

Another guy posted this link not too long ago. Seems like a good guide, although I haven’t tried it. https://symmetricdynamite.gitbook.io/backendless-appgyver

I think I saw another one posted in the appgyver forum by backendless staff. So there are a few guides around.

Hope that helps

1 Like

Thanks for the heads up !

This is not correct. You simply need a text column. You can convert to base 64 with appgyver, and concatenate with data:image/png;base64.

Example: PickImageFromLibrary => Set App Variable => Convert to base 64 => Create Record.

When converting to base64 concatenate using formula “data:image/png;base64” + output of app variable. And app variable is simply the path from the pick images from library.

1 Like

So we don’t need a file reference? Just text? And then convert the path to base64? What do you mean concatenate? On which one?

Yes, just text. Like this:

Okay, now I feel like an idiot :smiley:
You are genius.

1 Like

hmmm… but I’m getting failed when creating record.
Output error says 21000 limit reached?

Backendless DB Column type = JSON
Appgyver request is type = Object, replace id with an identifier like imageURL with type = text, then run your test under post.

To Get, simply use ImageUrl inside JSON object

2 Likes

Awesome!
It works!
I spent so many hours trying to figure that out :smiley:
Finally, a solution that works.

Have you tried uploading files yet? I also cannot seem to upload files to backendless using appgyver.

It would be great if you could make a video tutorial, or written guide. Lot of appgyver users looking for backend.

Yes, it is here:

File Upload - Backendless REST API Documentation

At the moment, I don’t have time for video. But I can offer screen shots for appgyver users that want to upload and retrieve images. Example:

UI Example

Image Upload Logic

Button Logic

Page Logic

Backendless DB

You will need one app variable.
And you will need one page variable.
App variable is to store image static url and to set image path from pick images from library.
Page variable stores base 64 + prefix

To retrieve image, run test, store response schema, create data variable, then bind the image to the imageUrl.

2 Likes

Hey is there any chance you could post the API URL you are using for the create record call? I’ve tried to set this up as per your screen shots and I’m getting an 8002 error - could not parse request with message :confused:

Hello @Joel_Maclean

Perhaps we can help you if you indicate which request leads to this error.

Is it possible to do this without using base64 and upload directly into the files storage?

as in
File Upload - Backendless REST API Documentation.