Jul 01, 2024 03:29 AM - edited Jul 01, 2024 04:09 AM
Hey everyone. I have a public URL link that I'm trying to use to upload to an airtable attachment field with airtable scripting. This is my code (the URL is obtained from an API call response):
Jul 01, 2024 09:52 AM
What are the values for fileName and responseData.pdf? (Is responseData an object with a property of pdf that contains the actual url?)
Usually when the record history shows an attachment uploaded and immediately deleted it is because Airtable was not able to download the file. Here are some common reasons.
- The url provided is not a public url. If the url requires the user to be logged in, the upload will not work. To test if the url is a public url, try using an incognito or private window of the web browser.
- The url is a "viewer" url that opens a webpage that displays the file in a viewer, versus directly showing the raw file.
- The url is invalid. Usually you can tell if this is the case because you don't get the file if you put the url in a web browser.
Jul 01, 2024 07:31 PM
Incorrect file types could be an issue too; the user in this thread tried to upload files with URLs ending with .jpg and those would delete themselves, turns out they were actually .avif files instead which I think was causing the issue
Jul 02, 2024 01:45 AM - edited Jul 02, 2024 02:46 AM
Thank you for your response! "responseData" is a JSON object, with one of the parameters being "pdf", which contains an url of the type "https://abc?fileName=defg%49.pdf" (this is not a valid one, just an example to show you the format, and I don't use the fileName given in the link, I define it as "test.pfd"). When I use this link in my web browser it downloads the pdf and it always works in incognito/private window mode also, so I know that my pdf is not a problem, because I can always access it. Do you have any other possible solutions? Because the link is always of the same type, obtained in the same way, but sometimes it's upload to airtable works sometimes it doesn't.