Help

The Community will be undergoing maintenance from Friday February 21 - Friday, February 28 and will be "read only" during this time. To learn more, check out our Announcements blog post.

Re: PATCHing attachment field leads to thumbnail corruption

533 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Martin_Malinda
6 - Interface Innovator
6 - Interface Innovator

Hello!

I'm using the API extensively in powersave to create and update records.

New records is created via `POST` and the attachment array gets processed just fine.

But then, when a record is updated via `PATCH` the previous attachment seem to get partially corrupted. They can still be opened and viewed in full size but none of the thumbnail are available.

I tried to send back the attachments in various formats:

{ id }
{ id, fileName, url }
{ id: fileName }

It seems to happen in all cases.

Is there any way I can prevent this? Thanks a lot!

 

4 Replies 4
ScottWorld
18 - Pluto
18 - Pluto

@Martin_Malinda

Hmmm... that is very strange. I wonder if there's a bug with Airtable's PATCH command? You might want to open up a support ticket with support@airtable.com to see what they have to say about this issue.

Also, I wonder if there's some bug with how PowerSave is sending the PATCH command to Airtable? Have you tried using the PATCH command with Postman to see if you get the same odd behavior in Airtable?

- ScottWorld, Expert Airtable Consultant

Thank you @ScottWorld . I think I don't need to re-test via postman since I can view all the data of the request in the chrome network tab. I see the exact object format that's being sent to the API.

But I will contact support directly, that's a good idea, thank you!

 

As a data point, I'm able to PATCH a record with an attachment and the thumbnail shows up for me! 

{
    "fields": {
        "Attachments": [{"url": "https://ssl.gstatic.com/ui/v1/icons/mail/rfr/logo_gmail_lockup_default_2x_r5.png"}]
    }
}

 And if I'm patching with a previous attachment, it'd look something like this, and the thumbnails showed up for both the original attachment as well as the new one:

{
    "fields": {
        "Attachments": [{"url": "https://v5.airtableusercontent.com/v3/u/38/38/1739332800000/NjfIivOC2jCx4gZrZnQt1Q/6hr13JBls_yboKbh6lvRbr_D20vt045_6wNsVn5xocVABD3e0WvJ5qWmiv0faKk5oJ-jFtvL7waKSnFT79x6EBeVi7l6KC6fIkGQxujkKAWsBkOlyYOVR9s5TkXrFauy6Wx-lBYGUZ9vHVzqCz7gstQ/Rjl3pWNtwBNTpyMclxoaI0xf6MqCHWCx5x4vYryBVb0"}, {"url": "https://ssl.gstatic.com/ui/v1/icons/mail/rfr/logo_gmail_lockup_default_2x_r5.png"}]
    }
}

 

@TheTimeSavingCo ah interesting, thanks a lot for checking!

In your subsequent PATCH request you're not sending the previous attachment ID. So I think in this case Airtable basically re-uploads and re-processes all images.

But this makes me think I could just go ahead with the same strategy, thanks a lot!