Content Upload is not generating URL/posting image
Hi, I'm new to Xano, No Code, APIs, Endpoints, and most things tech…
I am trying to follow the Content Upload tutorial (), but when it comes to running the API for posting an image, it does not create a URL - see the attached preview below.https://docs.xano.com/working-with-data/functions/content-upload
So the image name comes up in the database, but not the image.
Can anyone help?
Best Answers
-
I think you mean to reference the variable image rather than the input called image. The variable is a metadata object. The input is the file resource (from which you made the metadata object). Try changing the "image image" reference to the "var:" rather than the "input:" and I think you will get better results.
-
Hello @GavinReid
Thank you for sharing the screenshot. As I said above the issue is on the second function. The input is selected instead of the output from the first action. I understand that it is frustrating to select the right one so you could change the name of the output in the first function and then it will be more clear. Let me know if you still need help
-
@GavinReid you need to be very careful when using the same name for variables and inputs because Xano defaults to inputs when you fill in the input fields. In the AddRecord function you assigned the image input to the image field, which is incorrect. On the contrary, you must assign the image variable to the image field. the image input is a resource file type but the image variable and the image field are both image type, which is different.
Remember when you didn't understood well my 3rd step "add/edit the record assigning the result to the image field"? I meant the result of the second step, which is the image variable, not the image input.
Answers
-
Are you sure you followed the tutorial well?
- the source/input/variable/url/APIresponse/base64… must be treated as a file resource.
- convert the file resource to an image with CreateImageFromFile function.
- add/edit the record assigning the result to the image field.
-
Hello @GavinReid
Do you have the function "Create Image From File"?
Try to save the image you get from that function in a Table and then return that record.
We have already implemented APIs for Content Upload(Image, Video, PDF & Audio) and created a snippet
-
Hi @arturosanz and @Lefteris - buynocodeapps.com, thank you for your answers.
I think I have followed the tutorial very closely, but there must be something I'm missing. @arturosanz I'm not sure what you mean in your third step, and @Lefteris - buynocodeapps.com when I run the program I get a creeated_at in the table, but no image or name.
I notice that in the 'run & debug' there is only code relating to 'name', could that have something to do with it?
I'll attach screen shots of what I have done.
-
Hello @GavinReid
Thank you for sharing more info.
Could you please share a screenshot of the second function "Add Record in Photos"?
I think the issue is there -
Certainly @Lefteris - buynocodeapps.com
-
That has done the trick @Ray Deck , thanks for the help!
Categories
- All Categories
- 46 📣 Announcements
- 47 🦾 Releases
- 36 👋 Welcome
- 924 🤷 Help! I'm a Noob
- 113 📱 No-Code Front-Ends
- 597 🌐 Working with APIs
- 418 🔢 Transforming data
- 120 🔌 Connect Xano to ...
- 46 🧑💻 Find an Expert
- 320 ❓Other questions
- 32 🔐 Security
- 22 ✂️ Snippets
- 19 🏆 Showcase
- 7 🗣️ Xano Chatter
- 60 📺 Video Tutorials
- 166 🙏 Request a feature
- 219 🐞 Report a Bug
- 19 🚀 Templates & Extensions
- 6 💬 Feedback