# WEB API Firebase Storage It does not upload the file to the server

**URL:** <https://community.thunkable.com/t/web-api-firebase-storage-it-does-not-upload-the-file-to-the-server/2369895>\
**Category:** Web API's\
**Tags:** firebase, database, beginner, help, storage\
**Created:** [April 13, 2023, 4:49am UTC](https://community.thunkable.com/t/web-api-firebase-storage-it-does-not-upload-the-file-to-the-server/2369895 "2023-04-13T04:49:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [April 14, 2023, 11:24am UTC](https://community.thunkable.com/t/web-api-firebase-storage-it-does-not-upload-the-file-to-the-server/2369895/4 "2023-04-14T11:24:33Z")

</div>

Hello @whiterabbitstudio202  
I’ve already created an app that uses the API Block to send an image file.  
I used Web Viewer and HTML code to convert the image file to base64 and then send it through the API.

This is the code for HTML:

```auto
<!DOCTYPE html>
<html>
<body style="background-color:#18A2EB;">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Convert local file to Base64</title>
    <script 
    src="https://thunkable.github.io/webviewer-extension/thunkableWebviewerExtension.js"
    type="text/javascript"></script>
    <style>
      .choose::-webkit-file-upload-button {
        color: white;
        display: inline-block;
        background: #1CB6E0;
        border: none;
        padding: 7px 15px;
        font-weight: 700;
        border-radius: 3px;
        white-space: nowrap;
        cursor: pointer;
        font-size: 10pt;
      }
    </style>
  </head>
  <body>
    <input type="file" accept="image/*" class="choose" onchange="encodeImageFileAsURL(this)" />
    <script>
      function encodeImageFileAsURL(element) {
        let file = element.files[0];
        let reader = new FileReader();
        reader.onloadend = function() {
          ThunkableWebviewerExtension.postMessage(reader.result);
          document.write('RESULT: ', reader.result);
        }
        reader.readAsDataURL(file);
      }
    </script>
  </body>
</html>

```

You can find the project [here](https://x.thunkable.com/projects/6439364670a0fe62a9e6edf7/5b9ddc5e-5b0a-44ae-8c4c-f047c0fb634e/settings)

---

_[View the full topic](https://community.thunkable.com/t/web-api-firebase-storage-it-does-not-upload-the-file-to-the-server/2369895)._
