Set externally uploaded file field through API
Hello! How can I set externally uploaded file field through API? This is what I managed to get, but the main problem is that "url" is prefixed with XANO domain
{ "path": "https://cdn-api-dev.jetadmin.app/media/static_files/projects/test_1251/slideout_TBlx6gL.svg", "name": "slideout_TBlx6gL.svg", "type": "image", "size": 0, "mime": "image/svg+xml", "meta": {}, "url": "https://x8ki-letl-twmt.n7.xano.iohttps://cdn-api-dev.jetadmin.app/media/static_files/projects/test_1251/slideout_TBlx6gL.svg" }
Answers
-
Hi @d.kildishev - I'd love if you can elaborate with more context into your use-case. I might be able to provide more guidance. But for a quick fix, you can use the trim filter to trim your Xano domain of the URL.
-
So the main case is that I want to set "attachment" with URL which is not hosted on Xano, but whatever I tried - it always prefixes "url" field with "https://x8ki-letl-twmt.n7.xano.io".
We have an integration with your product where users connect Xano, but have files uploaded not on Xano and they need to save such files to Xano API. So we can't modify our users endpoints to trim domain of the URL.
-
Can you please show how you're creating the image in the function stack? I'm a little confused why your URL would be like so. Are you providing a value for the filename in the Create Image Metadata function?
-
I'm using default Application table from Templates and I have image which is externally uploaded. I want to set this image to database without uploading it again.
-
@d.kildishev - I wouldn't use the image data type in that case. Since you already have the attachemnt URL, I'd just store the attachment URL as a text field in Xano. The attachment/image/video/audio data types are designed to be used with Xano's media uploader - which is why you have your Xano domain added to the existing URL. If you want to store additional metadata then you can do that separately.
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