Help

Dissapearing images after writing to attachment field

Topic Labels: Scripting extentions
154 7
cancel
Showing results for 
Search instead for 
Did you mean: 

Writing valid .jpg URLs to an attachment field - one of them is saved as normal, one of them fails to show a preview whilst loading, then gets cleared completely. I saw it 1st in Data Fetcher and then wrote a script to reproduce it:


// This URL is fine
const url1 = 'https://upload.wikimedia.org/wikipedia/commons/7/7a/Galileo_moon_phases.jpg';
// This URL does not work for some reason
const url2 = 'https://www.haven.cz/_scripts/slir/w1200-h1200/eshop/batohy-hydrovaky/luminite-ii-18l-green/1-batoh-luminatte-ii-green-male.jpg';

const table = base.getTable('Table 5');
let query = await table.selectRecordsAsync({fields: table.fields});
for (let record of query.records) {
    await table.updateRecordAsync(record, {
        'Image1': [{url:url1}],
        'Image2': [{url:url2}],
    });
}
console.log('Done')

Here’s a video of the issue: Loom | Free Screen & Video Recording Software | Loom

@Will_Powelson @SeanKeenan please let me know if there is someone better from the Airtable team to tag, or a better way of reporting potential issues.

7 Replies 7

I’ve also been able to reproduce this via the REST API and the UI.

If you pop the URL into the Filestack modal you get an error

image

image

Thanks! Looks like this issue has been seen before: Attachment download inconsistant - #21 by Bill.French and Looking for a solution or workaround for "Error Fetching URL Meta Data".

Would love to hear from Airtable if there’s a workaround.

I don’t believe a workaround for this has ever been discovered. I noticed this issue in 2019 and I’ve been complaining about it since. I have taken no less than seven clients in front of Airtable support with deep details and examples, and not in a single case was the “bug” confirmed, or an API-based alternative suggested.

I have also found cases where specific URLs repeatedly fail to attach as well as many cases where URLs will fail and later, they will succeed.

Thanks for confirming I’m not going mad! Really strange issue but doesn’t sound like it’ll be sorted any time soon

You may actually be mad, but this is not the reason.

I do note with great speculation, the underlying error that occurs when you attempt to GET the image that fails to upload.

image

Ha!

Interesting - I don’t see any of those errors in the Firefox or Chrome console.

Screenshot 2022-11-27 at 10.21.32

The widget on the official docs has the same error behaviour: Filestack Docs | JavaScript File Picker

The client is open source but the API it calls isn’t. Didn’t find anything useful in their GitHub issues. Not convinced I’d get any answers diving in there.

Seems like any image I’ve plucked from this domain has this issue. I don’t know what the variable is. I tried serving content with similar HTTP headers and didn’t manage to reproduce the issue. If anyone has other domains they’ve had issues with we might be able to get closer to the cause?

One working solution solution is to have a proxy server fetch the image and respond with the data

Here’s one I deployed https://airtable-image-proxy.goksan.workers.dev/{image_url}

Example:
https://airtable-image-proxy.goksan.workers.dev/https://www.haven.cz/_scripts/slir/w1200-h1200/eshop/batohy-hydrovaky/luminite-ii-18l-green/1-batoh-luminatte-ii-green-male.jpg