Get file metadata
Retrieve document file metadata such as filename, MIME content type, and page count using the getFileMetadata computed field method in Sensible.
Gets metadata about the document file.
Parameters
The following parameters are in the computed field's global Method parameter:
| key | value | description |
|---|---|---|
| id (required) | getFileMetadata | |
| type | filename,contentType, pageCount | If you specify filename, outputs the document's filename without the file extension. Sensible gets the filename from the Document Name parameter if you extract through the Sensible API or SDKs, or assigns a document name on upload if you use the Sensible app.If you specify contentType, outputs the document's MIME content type, for example, image/jpeg or application/pdf.If you specify pageCount, outputs the page count of the document. If the document is part of a portfolio extraction, outputs the page count of the sub-document in the portfolio. |
Examples
The following example shows extracting the filename from the example document.
Config
{
"fields": [
{
"id": "doc_filename",
"method": {
"id": "getFileMetadata",
"type": "filename"
}
}
]
}Example document
The following image shows the example document used with this example config:
| Example document | Download link |
|---|
Output
{
"doc_filename": {
"value": "utility_statement_gas_dec_2019",
"type": "string"
}
}Updated 18 days ago
Did this page help you?