# Upload Data stream to Xano

**URL:** <https://community.weweb.io/t/upload-data-stream-to-xano/4634>\
**Category:** How do I?\
**Tags:** xano\
**Created:** [September 28, 2023, 8:40am UTC](https://community.weweb.io/t/upload-data-stream-to-xano/4634 "2023-09-28T08:40:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduardJ](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@eduardJ](https://community.weweb.io/u/eduardJ)\
**Post date:** [September 28, 2023, 8:40am UTC](https://community.weweb.io/t/upload-data-stream-to-xano/4634/1 "2023-09-28T08:40:47Z")

</div>

Hi,

I am working on a feature where you can modify or upload a new template.  
Uploading a new template is straightforward and documented well in WeWeb, but programmatically uploading a data stream to Xano is not working, here is what I am doing:

I am getting a base64 binary stream of a docx file returned from a Xano Request and now I need to upload it to a different Xano Endpoint, but I am not able to get it to work, I’m able to download the file/binary stream locally easily but I’m not able to programmatically add it to the request and upload it,

I am getting this error:

> stack: "Error: Request failed with status code 400 at e.exports ([https://editor-cdn.weweb.io/public/js/chunk-vendors.7f825e18.js:1:103697](https://editor-cdn.weweb.io/public/js/chunk-vendors.7f825e18.js:1:103697))…

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [September 29, 2023, 11:38am UTC](https://community.weweb.io/t/upload-data-stream-to-xano/4634/2 "2023-09-29T11:38:09Z")

</div>

Hi @eduardJ,

Does [this section about file uploads directly to the backend](https://docs.weweb.io/workflows/actions/file-upload.html#upload-to-backend) help by any chance?

I’m thinking maybe not since you’re already managing to upload new templates to Xano 😕

If not, could you share a short video of how things are setup in your WeWeb project and Xano workspace and showing us where you’re stuck?

It’ll help me understand the whole flow and hopefully find a solution for you!

---

<div class="post-metadata">

**Author:** ![eduardJ](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@eduardJ](https://community.weweb.io/u/eduardJ)\
**Post date:** [September 29, 2023, 12:29pm UTC](https://community.weweb.io/t/upload-data-stream-to-xano/4634/3 "2023-09-29T12:29:59Z")

</div>

Hy @Joyce thnx for the reply,

I tried that section but it didn’t help, I found a way of uploading the document via a custom js function which makes an xhr request, which is exactly what the Xano request should have been doing all along but whenever I try passing the same object to the Xano request all I get is:

> Request failed with status code 400

It seems that whenever here is my payload:

```auto
{
    "title": "test name",
    "clientId": 999,
    "description": "asdasd",
    "file_resource": {}
}

```

as you can see the file resource is an empty object even though I get this object from this action:

![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/6/6a421b3c0020565876f1de046f7d27daadf5452d.png)

If there is a way to make this custom javascript function asynchronous and return a result that would solve my issue.

---

<div class="post-metadata">

**Author:** ![eduardJ](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@eduardJ](https://community.weweb.io/u/eduardJ)\
**Post date:** [September 29, 2023, 12:31pm UTC](https://community.weweb.io/t/upload-data-stream-to-xano/4634/4 "2023-09-29T12:31:53Z")

</div>

Here is another image I’m not able to upload more than one since am a new user:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/b1e991bbe22b2286103a7ce75ceb3450c21b8105.png)

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [September 29, 2023, 3:28pm UTC](https://community.weweb.io/t/upload-data-stream-to-xano/4634/5 "2023-09-29T15:28:14Z")

</div>

Alright. I don’t have a lot of experience with this use case. Let me ask someone on the tech team if they can help 🙂

---

<div class="post-metadata">

**Author:** ![Joyce](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/joyce/32/13232_2.png) [@Joyce](https://community.weweb.io/u/Joyce)\
**Post date:** [October 5, 2023, 4:43pm UTC](https://community.weweb.io/t/upload-data-stream-to-xano/4634/6 "2023-10-05T16:43:00Z")

</div>

Alright! The team says it should work if you build the data url yourself, something like this `data:app/vnd.blabla;base64,<thebase64string>`

Does that help?

---

<div class="post-metadata">

**Author:** ![eduardJ](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@eduardJ](https://community.weweb.io/u/eduardJ)\
**Post date:** [October 6, 2023, 7:12am UTC](https://community.weweb.io/t/upload-data-stream-to-xano/4634/7 "2023-10-06T07:12:10Z")

</div>

Hey @Joyce ,

We went with a different solution moving the logic to Xano completely (download and upload of the document), this solved our issues.

Thanks for your reply.
