Jun 13, 2023 06:21 AM
Hey everybody,
with the CDN changes in Airtable, i am now looking on storing our data (mainly images and documents/pdf) to our own Nextcloud instance and fetching those links back to AT. I have been doing some research, but nothing really helpful came up and i am a bit confused with the Nextcloud documentation.
Did anybody do this yet?
Ideally i would like to achieve this with an Airtable Script.
I am familiar with APIs and Airtable Scripting.
For the complete picture, this is what needs to happen:
1. Upload of files to an attachment field via a form or user upload.
2. Upload triggers script, which transfers file to Nextcloud location.
3. After complete transfer, the public link to the file in Nextcloud is stored in AT.
It's mainly No. 2 i'm struggling with right now.
Any help appreciated!
Jun 13, 2023 07:20 AM
I don't know scripting, so I can't help you there.
If you want a non-scripting way of doing it, you can simply use Make's NextCloud API integrations.
There can be a bit of a learning curve with Make, which is why I created this basic navigation video for Make, along with providing the link to Make’s free training courses.
Jun 13, 2023 07:52 AM
You’ll need to get the URL from the attachments field, then fetch the files from Airtable since nextcloud is looking to for raw files to be uploaded.
Then you can send the fetched raw files via API call to nextcloud. nextcloud docs say use the PUT method to upload files.
Then there might be a header in the response that contains file ID or something you can use to identify the URL path of the uploaded file.
I’ve never done it but that’s what I’d try first after glancing at the docs.
Jun 14, 2023 06:41 AM
Thank you both!
I'll have a look at using MAKE, although i'd rather like to do this with only Airtable and Nextcloud.
Regarding the API approach: I technically know how to do it - i was just hoping somebody, who might have done it before, could point out how to call the Nextcloud API with Airtable Scripting only (which is limited to JavaScript basically).
Jun 15, 2023 06:54 AM - edited Jun 15, 2023 06:55 AM
@Stephen_Orr1 : I've come a bit farther on this. Made successful API calls with Postman (at least).
Now it looks as if i have to get an image in binary code to make it uploadable to Nextcloud, which would be my body in an API call. Do you have any idea on how to get this from Airtable?
In Postman i can just upload the file and it will translate to the right format - but that's of course not working for an automated upload.