Help

Re: Extract File Size from From Attachments

4556 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Gracias
4 - Data Explorer
4 - Data Explorer

I am facing issue in Files Table. I have column name “File” ,I did the setup to get the size using formula, in column “File size” but that is not working now. Can you please help me with this issue?

Actually, It was working till yesterday , but today it stopped working and I cannot find the formula. Can you please help me out with the task, I jsut want formula to get File Size from From Attachments.

12 Replies 12
ScottWorld
18 - Pluto
18 - Pluto

There isn’t a formula to get the file size from attachments, but you can get it through Airtable’s automations, which will reveal the size of attachments.

Alternatively, you can get the file size through any tool that has access to the Airtable API, such as scripting, datafetcher.com, Make’s automations and integrations, or MiniExtensions’ attachment size extension.

p.s. If your company has a budget for your project and you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consulting — ScottWorld 

Hey @ScottWorld Can yo help me with more information on Automation that will revel the size of Attachments.

ScottWorld
18 - Pluto
18 - Pluto

You could trigger your automation with a checkbox field or a single-select field, and then update the record with the size of the attachment in a separate size field.

Check out this thread on how to instantly trigger a Make automation from Airtable.

p.s. If your company has a budget for your project and you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consulting — ScottWorld 

Our On2Air Actions app has a function that will calculate the sum of all file sizes in a field.

______________________________________
Hannah - On2Air.com - Automated Backups for Airtable

Hi,

may be useful for you, some time ago i did a script to count size of all attachments in all base per table

const inMb=(bytes)=>(bytes?`${Math.round(bytes/Math.pow(1024,2))} Mb`:'');const ts=[];

for(var table of base.tables) ts.push(await count(table))

if (sum(ts)) {output.table(ts.filter(n=>n).map(x=>(x?{size:inMb(x.size),name:x.tname}:{})));

output.markdown(`**Total: **${inMb(sum(ts)?.size)}`)}

function sum(arr){return (!arr||!arr.length||!(arr.some(n=>n)))? null:

{size:arr.filter(n=>n).map(x=>x.size).reduce((x,y)=>x+y),tname:table.name}};

async function count(table){

  let flds=table.fields.filter(fld=>fld.type.includes('Attach'));

  let query=await table.selectRecordsAsync({fields:flds});

return sum(flds.flatMap(fl=>query.records.map(x=>x.getCellValue(fl)).map(sum)));}

Hey, hanks for he reply, I just want to calculate the Size of one file at a time and Use to Script to calculate every new file added in my Airtable Row and File size into its Corresponding table.
Can you help me with that.

Eli_Mag
4 - Data Explorer
4 - Data Explorer

I’m also looking for a solution to calculate a single file, this is really odd it doesn’t exist.

The only way that you can calculate the size of a single file within an attachment file that contains multiple files in it would be to loop through the array of all the attachments in that field.

As of 2023, looping is now supported by Airtable’s Automations, so you can now do this with Airtable’s automations.

However, it’s usually recommended to use Make’s advanced automations to do these sorts of advanced automations.

In Make, you loop through arrays using its iterator tool.

I give a demonstration of working with attachment arrays on this Airtable podcast episode.

And here is how to instantly trigger a Make automation from Airtable.

p.s. If your company has a budget for your project and you’d like to hire an expert Airtable consultant to help you with any of this, please feel free to contact me through my website: Airtable consulting — ScottWorld 

christoph
6 - Interface Innovator
6 - Interface Innovator

Is there a better way meanwhile?

Or could you, @ScottWorld please elaborate how an Automation could be used to get the file size? I am quite familiar with automations in general, however, I don't get what you are referring to.