Help

Re: Attachment Full Preview in API

1566 2
cancel
Showing results for 
Search instead for 
Did you mean: 
jacktilly
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi Airtable community,

I am stumped with a bit of an annoying task here. We have an attachment field in our Airtable base where we attach DOCX files. We want to return this field as a part of an API response from our custom API, and we want to do a full preview of the DOCX as an image, to be served to our website. I know the endpoint returns a thumbnail image, but this is pretty small and blurry. I was wondering if there was a way to fetch a larger thumbnail, or a full page preview, of the DOCX file from Airtable’s API.

If anybody knows of how to figure this out, in any way possible, I would greatly appreciate it. Thank you!

Jack Tilly

3 Replies 3
Jono_Prest
6 - Interface Innovator
6 - Interface Innovator

An idea for you is that you could return the url for the .docx file via the API and then render it in an iframe on your front end using Microsoft or google’s browser viewer. I have not tested this and you may have to play around with it a bit but it could look something like this:

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=http://remote.url.tld/path/to/document.doc' width='1366px' height='623px' ></iframe>

That is a great idea. Half of the reason for doing this as it is a “preview”, and we really don’t want the user being able to have access to the file itself, but I can mess around with the idea and see if theres a way to hide the document itself from public access.

Ah I see.

The browser viewer would be read only but I don’t think you would be able to stop a user from finding the source url and downloading the .docx file.

The Airtable thumbnails are not really decent enough quality to actually read a document. Perhaps it would be best to either save the .docx file as an image and keep that in a separate field to serve to the user. Or use an API service like cloudmersive to return an image format of document. That kind of parsing should probably be done before the request of a user though as I’m sure load times would be awful.