Step by step to save an image and get it's xano url?
Options
![Jay](https://us.v-cdn.net/6037124/user_avatars/2364889.jpg)
Jay
Member ✭
Feeling extra dumb today so i hope someone can help spell this out for me.
I went through this document and it's still unclear to me how to save an image to the database from an API call coming from Draftbit, and then get the URL of the saved image to use in a function.
I also don't understand what's arriving in the file resource image input, and what's the difference and use between all these options:
[Image]
What would be the step by step to save an image and get the URL?
Thanks
I went through this document and it's still unclear to me how to save an image to the database from an API call coming from Draftbit, and then get the URL of the saved image to use in a function.
I also don't understand what's arriving in the file resource image input, and what's the difference and use between all these options:
[Image]
What would be the step by step to save an image and get the URL?
Thanks
Comments
-
Hi.
Usually I am sending a URL to XANO via POST, then I use the first option "Create Image Metadata" into a variable
the "mImage_" is where I send the Image URL (In your case a Drafbit image upload, something like that).[image.png]Then I edit the record, using a field Image to update with the "VAR_1"
[image.png]the action "2." will add the image to the database and response should give you the Image URL from XANO. -
Creating images, videos, attachments follow these steps:
1st - input your image using the File Resource input type
2nd - Create the Metadata from the File Resource using the Create Metadata function... (there are specific Create Metadata Functions depending if you're doing an image, video, audio file, or attachment)
3rd - Using the Variable created from the Create Metadata Function, map this to the storage field in your DB table.
The image URL isn't actually stored as part of the metadata. The URL is generated on the fly when retrieving a file from the Database for convenience. You can create an image URL once you have the Metadata (so even before adding it to the database). The URL consists of your Xano domain (e.g. https://x1xx-abcd-aaaa.n7.xano.io) and the "path" which is part of the Metadata object. If you concatenate both values you get the URL. -
Thanks, this clarifies most of it. But the url part is still not clear to me. There isn't anything that just generates it and provides it whole? Do i always have to construct it for the url and path?
-
Database request functions (e.g. Edit Record, Get Record, Add Record, etc.) will be the only functions that give you the URL automatically
-
I'm creating an image and adding it to the db like this:
[image.png]The output is this:
[image.png]Then i try to use the returned object Feedback.Image:
[image.png]But what i see in the email api call is this big neted structure:
[image.png] -
Michael Udinski any insight?
-
I'm a little confused here -can you please help clarify here. I'm seeing your last screenshot which looks like an External API Request response -- is this somehow related to adding an image to your database or am I missing something?
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