Extracting metadata from file

Hey,

I am looking for a way to extract metadata from a file. This file is not a PDF or any standaard file. You can only open it if you have the correct software. However I do not need the data inside the file, I only want to know when the file was created so I can display this in a column next to it. I have looked at different packs, but they all don’t talk about extracting metadata. I have also thought about maybe using a bit of JavaScript, but I have no idea how to intergrate it with coda. Does anybody know how I would be able to do this?

Hey! I don’t think you can get that data from an uploaded file. It’s only available on your local file system — but data like this is not embedded in the file itself and is not transferred to Coda when the file gets uploaded, only the binary contents of the file are. So even if there were a way to get a timestamp of the uploaded file, that would be the timestamp of when the file was created on Coda’s servers.

The name and the extension of the file can be extracted directly in Coda; file size can also be retrieved through the pack (i.e. the pack can ‘download’ the first zero bytes of the file and learn the whole size of the file from the response headers of such request.) But as for the timestamps, unfortunately they are not preserved.

JavaScript exists in Coda in custom packs — a platform of extensions that run on lambdas (i.e. not in your browser, so those are for backend/middleware functionality and not e.g. UI customization of Coda.) You can read more about custom packs here:

P.S. The metadata could actually be embedded in your files — some formats like Word documents, ZIP archives or all sorts of images (JPG et al) preserve it internally in the file. If that’s the case, those can be extracted — e.g. for photos you can extract what was the time and date the picture was taken, and also what kind of camera, what kind of lens, which were the white balance settings etc. But those are only specific to specific formats.

Can you share an example file?