# How to save Blobs in database?

**URL:** <https://forum.adalo.com/t/how-to-save-blobs-in-database/21266>\
**Category:** Database\
**Created:** [December 25, 2021, 12:35am UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266 "2021-12-25T00:35:49Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [December 25, 2021, 12:35am UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/1 "2021-12-25T00:35:49Z")

</div>

How do I save file-like data into the Adalo database?

Blobs or buffers etc.

The formValue seems to only be able to save one of these types: [https://developers.adalo.com/api-reference/configuration/manifest-json/#type](https://developers.adalo.com/api-reference/configuration/manifest-json/#type) text, number, boolean, icon, color, date, list, action

action may be the most promising, how do I use that to save a Blob in the database?

Since a database can have a File property, it seems likely Adalo supports exporting data from a component into that field of a database

---

<div class="post-metadata">

**Author:** ![TKOTC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tkotc/32/6863_2.png) [@TKOTC](https://forum.adalo.com/u/TKOTC)\
**Post date:** [December 25, 2021, 5:08am UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/2 "2021-12-25T05:08:23Z")

</div>

Convert to base64.

Something like Buffer.from(content).toString(“base64”)  
Should do it

---

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [December 25, 2021, 11:25am UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/3 "2021-12-25T11:25:33Z")

</div>

That’s unfortunately poor compression, I’d rather store the binary data directly, and it seems like it should be supported since the database even has a File column datatype

---

<div class="post-metadata">

**Author:** ![TKOTC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tkotc/32/6863_2.png) [@TKOTC](https://forum.adalo.com/u/TKOTC)\
**Post date:** [December 25, 2021, 2:53pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/4 "2021-12-25T14:53:11Z")

</div>

As you pointed out in the component maker manifest, makers don’t have the ability to upload files. You can use the S3 service from @theadaloguy (I think it is his) or build your own component to store files in your own S3 bucket (or other file system). Otherwise base64 is the only option available to us.

---

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [December 25, 2021, 4:09pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/5 "2021-12-25T16:09:11Z")

</div>

Thank you for the information. Do you happen to know how the built-in file Picker component works?

---

<div class="post-metadata">

**Author:** ![TKOTC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tkotc/32/6863_2.png) [@TKOTC](https://forum.adalo.com/u/TKOTC)\
**Post date:** [December 25, 2021, 4:43pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/6 "2021-12-25T16:43:50Z")

</div>

Yes, when you choose a file it posts to the adalo database endpoint which saves it to an S3 bucket with a random unique id and shows a preview using base64 encoding. Then when you save the record it will save the unique IDof the file in the database as text for future retrieval.

---

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [December 25, 2021, 6:19pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/7 "2021-12-25T18:19:47Z")

</div>

Why can’t a custom component do that?

---

<div class="post-metadata">

**Author:** ![TKOTC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tkotc/32/6863_2.png) [@TKOTC](https://forum.adalo.com/u/TKOTC)\
**Post date:** [December 25, 2021, 7:12pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/8 "2021-12-25T19:12:12Z")

</div>

It can technically, but building things outside of the developer docs is against the rules so accessing and posting file records is off-limits. But it is very possible if you know what you are doing as seen in the video in the post below

[https://forum.adalo.com/t/every-new-beginning-comes-from-some-other-beginnings-end/20485/38](https://forum.adalo.com/t/every-new-beginning-comes-from-some-other-beginnings-end/20485/38)

> [@Every new beginning comes from some other beginnings end](https://forum.adalo.com/t/every-new-beginning-comes-from-some-other-beginnings-end/20485/52):
>
> I open sourced the fixed version of the current signature, which I believe the only issue was with Safari web browser. It is here. For the one in the video that updates the database, I cannot release it. At present maker components are what we call second-class citizens (not that they are terrible, deep linking and geolocation are top tier components). Adalo components are a mix of second-class and first-class citizens. When looking at the app page you can see Navigation, Lists, Buttons, Simpl…

---

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [December 27, 2021, 10:06am UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/9 "2021-12-27T10:06:57Z")

</div>

Thank you. Where can I read the rules that are relevant to this part of Adalo? Do you know what action Adalo takes against developers that violate them?

---

<div class="post-metadata">

**Author:** ![TKOTC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tkotc/32/6863_2.png) [@TKOTC](https://forum.adalo.com/u/TKOTC)\
**Post date:** [December 27, 2021, 4:27pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/10 "2021-12-27T16:27:43Z")

</div>

I do not think there is any published guidelines, the only reason I know the limits is because I had a conversation with Adalo when I started releasing my components and my marketplace. The rules are that your component can only use what is in the API docs. There is no way to `POST` a file using the REST api, and even if you tried to use the REST api in your component you would expose your `Bearer` token client side. There is no documented way to access the file upload system that exists in Adalo. You also cannot wrap providers around the main app.

As far as I know there is no action Adalo has ever taken against any developer that violates this. I am sure if you built this just for your app, and not release it to the public it would be okay.

---

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [January 3, 2022, 5:03pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/11 "2022-01-03T17:03:23Z")

</div>

In the video in this thread, how did you get Signature Phone \> Signature Image to appear as an option in that menu?

---

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [January 4, 2022, 12:49am UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/12 "2022-01-04T00:49:26Z")

</div>

It might be using [Actions | Adalo](https://developers.adalo.com/docs/interactions/actions/#arguments-as-magic-text) right? But in arguments how do you specify the type to be a file?

````plaintext
{
  ...
  "props": [
    {
      "name": "exampleAction",
      "displayName": "Example Action",
      "type": "action",
      "arguments": [
        {
          "type": "number",
          "displayName": "Argument 1"
        },
        {
          "type": "text",
          "displayName": "Argument 2"
        }
      ]
    }
  ]
}```
````

---

<div class="post-metadata">

**Author:** ![TKOTC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tkotc/32/6863_2.png) [@TKOTC](https://forum.adalo.com/u/TKOTC)\
**Post date:** [January 4, 2022, 4:24am UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/13 "2022-01-04T04:24:22Z")

</div>

~~Seems like the folks at Adalo deleted my post with the video. Sad state of affairs~~ , setting the record straight, turns out it was me… I don’t remember the component. I think I took an input type image then figured out what the table and column id’s were so that I could upload the file and update the database.

You cannot upload files to the database, I believe Adalo deleting the video from the forum is further confirmation that they do not want you uploading files.

You will need to wait until Adalo added files to the API.

---

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [January 4, 2022, 3:25pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/14 "2022-01-04T15:25:14Z")

</div>

The video still seems to be there? [Every new beginning comes from some other beginnings end - #43 by TKOTC](https://forum.adalo.com/t/every-new-beginning-comes-from-some-other-beginnings-end/20485/43)

Do files get uploaded to an S3 bucket instead of the database?

---

<div class="post-metadata">

**Author:** ![TKOTC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tkotc/32/6863_2.png) [@TKOTC](https://forum.adalo.com/u/TKOTC)\
**Post date:** [January 4, 2022, 3:28pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/15 "2022-01-04T15:28:45Z")

</div>

I was talking about this one

 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/9/9adafd558f40c88d8a8c8d148fcec04bec3dc61e.png)

For the one in the video, it is saved as base64 in the adalo database text field.

---

<div class="post-metadata">

**Author:** ![yugi](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yugi](https://forum.adalo.com/u/yugi)\
**Post date:** [January 4, 2022, 3:44pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/16 "2022-01-04T15:44:25Z")

</div>

Oh that’s a shame .\_.

“upload the file and update the database”

Was the file uploaded to Adalo’s S3 instance or to your own?

And to “update the database”, with an input-type field, is it just text behind the scenes? Does it store the URL to the file?

My Collections API reference, even for Collections I have that have file types and image types, never show me what should go in the POST or PUT requests to save the Image or File.

---

<div class="post-metadata">

**Author:** ![TKOTC](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tkotc/32/6863_2.png) [@TKOTC](https://forum.adalo.com/u/TKOTC)\
**Post date:** [January 4, 2022, 3:48pm UTC](https://forum.adalo.com/t/how-to-save-blobs-in-database/21266/17 "2022-01-04T15:48:00Z")

</div>

In my original it was to the adalo database, but using code that I cannot publish.

You cannot POST or PUT files and images into the database from the API.

You need to reverse engineer how the file/image upload component works then use that to build your component. Reverse engineering is against the ToC of Adalo.
