Download an Image & Store it in a Xano Database
Options
Connor McCormick
Member ✭
Hello!
I'm currently following along with this video, Download an Image & Store it in a Xano Database, to try to access an image at a url endpoint and download it to my database.
The problem I'm running into is that when I try to Create Image Metadata (seen at this moment in the video) it consistently gives me this response:
```
Whoops! An error occurred.
Exception: Unsupported input
```
Stepping through the Function Stack, the issue seems to come at that Create Image Metadata step, where it seems that the function doesn't receive any input:
[image.png]Here's a screenshot of what my function stack looks like:[image.png]
I believe I'm following exactly the steps described in the video. Let me trace them:
1. Request the image with External API Request ✓
2. Use a filter to convert it to base64 ✓
3-4. Prepend the web data header `data:image/jpeg;base64,` using concat fliter ✓
5. Create Image Metadata (aka Create Image from File, for some reason the function name and the tooltip are different) ✓
[image.png]Any ideas what might be causing this? It feels like I'm doing things right
One final thing: I have confirmed that the image data that I'm trying to decode is properly formatted. If you'd like to try yourself here is the base64 text: [image.txt]
I'm currently following along with this video, Download an Image & Store it in a Xano Database, to try to access an image at a url endpoint and download it to my database.
The problem I'm running into is that when I try to Create Image Metadata (seen at this moment in the video) it consistently gives me this response:
```
Whoops! An error occurred.
Exception: Unsupported input
```
Stepping through the Function Stack, the issue seems to come at that Create Image Metadata step, where it seems that the function doesn't receive any input:
[image.png]Here's a screenshot of what my function stack looks like:[image.png]
I believe I'm following exactly the steps described in the video. Let me trace them:
1. Request the image with External API Request ✓
2. Use a filter to convert it to base64 ✓
3-4. Prepend the web data header `data:image/jpeg;base64,` using concat fliter ✓
5. Create Image Metadata (aka Create Image from File, for some reason the function name and the tooltip are different) ✓
[image.png]Any ideas what might be causing this? It feels like I'm doing things right
One final thing: I have confirmed that the image data that I'm trying to decode is properly formatted. If you'd like to try yourself here is the base64 text: [image.txt]
Comments
-
Before creating the image metadata you must create a file resource using the create file resource function.
What format are you receiving the image from in your external API request response? I'm curious why you are trying to transform it to a base64 file before adding it to the database, could be unnecessary especially if you are already returning an image URL -
Thanks for the response !
My intention is to do nothing more than to grab an image from a url and then store it.
How would you go about this. Is the linked video tutorial not the way? -
I guess I can just do this:
[image.png]
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback