I’m working with Airtable as my database for a mobile application and running into a challenge with file uploads.
Based on the API documentation, it seems like uploading files or images requires providing a URL to the file rather than uploading it directly. The docs mention that when creating attachments, you need to set the field value to an array of attachment objects where the url property is mandatory.
// Current approach based on docs
const recordData = {
fields: {
'ProfilePhoto': [
{
url: 'https://myserver.com/uploads/photo123.jpg',
filename: 'user_photo.jpg'
}
]
}
};
This means I have to:
- Upload the file to my own server first
- Generate a public URL for that file
- Send that URL to Airtable
- Wait for Airtable to download and store its own copy
Is there any method to bypass this workflow? Can I send the file data directly to Airtable without needing my own file storage solution? It would be much simpler if I could upload directly and then retrieve the Airtable-hosted URL for future use.