Re: Cannot upload PDF-attachments with CURL

1051 0
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer


I have Valuations field in my Airtable DB. It’s type is set to “Attachment” and it stores PDFs. I populate it manually.


I’ve got a VBA-script with embedded CURL-commands that works as follows:

  1. Record values in several fields
  2. Delete all rows.
  3. Insert new sample enriched with the recorded data in rows with matching IDs, i.e. from step 1.


Despite the fact that I have recorded the JSONs of each attachment in “Valuations” I get #422 Error whenever I launch my CURL to create an updated record containing attachments in “Valuations”. Please, have a look at the JSON below. Any advice will be highly appreciated.

“filename”:“Valuation-Workbook_3284-3286-Sullivant-Ave-Columbus-OH-43204_2018-12-27-11-11-09 (1).pdf”,

4 Replies 4
5 - Automation Enthusiast
5 - Automation Enthusiast

Me too, please anyone HELP!

8 - Airtable Astronomer
8 - Airtable Astronomer

Try using only the “url” and “filename” parameter.
Perhaps the size, width, height etc are not matching up with Airtable’s calculation of said file…not sure though.

Are you able to directly update/create the record via curl on your terminal?

6 - Interface Innovator
6 - Interface Innovator

Airtable needs your files to be hosted on a webserver. So you cannot use a url that is from your filesystem. Where are the files hosted?

4 - Data Explorer
4 - Data Explorer

Thank you guys for sharing your expertise!

I have investigated this situation and was able to find the following:

  1. In order to insert an attachment by a CURL command it is sufficient to provide just its URL.
  2. If your source file is stored in OneDrive you cannot get its URL directly from the browser address box because OneDrive uses redirects that CURL commands cannot reproduce. You need to send XML-query to google drive to obtain genuine underlying URLs of your attachment-files and insert them into your CURL commands posted to Airtable. I did that and it worked like a charm.

NB! Example of a direct URL of a file that is stored on