Encode Base64 not working with jpg

Hi, following this tutorial: https://www.youtube.com/watch?v=vyEQhtr8nM0

I’m stuck on Encode file as base64. When I use it in the guide with just a basic jpg I get:

message: “Failed to execute ‘readAsDataURL’ on ‘FileReader’: parameter 1 is not of type ‘Blob’.”

I have no idea what is being done different from the tutorial.

What are you passing into the action?

I am just uploading this and using the file component WeWeb provides and then following the steps in the video

Hi William,

Are you using the file upload element like in the tutorial?
Can you share a screenshot of your workflow for that element?
Did you make sure you selected “Data Url“ toggle instead of base64?
Like this:

Hi @Agustin_Carozo , here are screenshots of the workflow:

The file upload is in a form now, it still doesn’t work but it didn’t work before when it wasn’t a form. Is the workflow from the video incompatible with the new file upload? Or is there a setting somewhere that has to be toggled?

Hi William, my mistake, I didn’t realize you were using the new file upload element.

This new element already has a native option to expose the file as base64, so you can upload it directly to Xano. (You don’t need to use the “encode to base64 action“)

1 Like

Thank you!