Reference > Functions reference > Container functions > GetContainerAttribute
 
GetContainerAttribute
Purpose 
Returns the file metadata of the specified container field.
Format 
GetContainerAttribute(sourceField;attributeName)
Parameters 
sourceField - the name of a container field.
attributeName - the name of a supported attribute (see below).
Data type returned 
text, number, date, time, timestamp, container
Originated in 
FileMaker Pro 13.0
Description 
Some attributes may not return a result. For example, the values for the latitude and longitude of a photo may not be available, or some audio metadata like album art may not be available because the metadata is stored outside the audio file. Some individual attributes in the group attribute all may not be applicable in some circumstances.
Tip  To minimize the frequency with which FileMaker Pro analyzes container data, use GetContainerAttribute in a field's auto-enter calculation and deselect Do not replace existing value of field (if any). In this case, GetContainerAttribute will update only when the contents of the specified container field change. If GetContainerAttribute is used in a calculation field definition, the calculation may update each time the current record changes, reducing the performance of your solution.
Attributes
 
Attribute
Returns
Data type returned
General
 
 
filename
The name of the file inserted into the container field.
text
MD5
The result of applying the cryptographic hash function MD5 to a file inserted into the container field or a file referenced by a container field.
text
storageType
The method used to store the data in the container field: Embedded, External (Secure), External (Open), File Reference, Text.
text
fileSize
The size (in bytes) of the file inserted into the container field.
number
internalSize
The amount (in bytes) of the space inside the database file that is occupied by the container field.
number
externalSize
The amount (in bytes) of the space that is stored externally by the container field. This is either the size of the referenced file or the total size of all files in the container field (set up for open or secure storage).
number
externalFiles
A list of the external files associated with the container field (either files using open or secure storage or a file reference).
text
 
 
 
Images
 
 
width
A number representing the width of the image in pixels.
number
height
A number representing the height of the image in pixels.
number
dpiWidth
A number representing the horizontal DPI of the image.
number
dpiHeight
A number representing the vertical DPI of the image.
number
transparency
1 if the image has an alpha channel, otherwise returns 0.
number
 
 
 
Photos
 
 
 
Note  Only JPEG and TIFF files return results.
 
orientation
A number representing the orientation of the photo:
1 (Normal)
2 (Flipped horizontally)
3 (Rotated 180 degrees)
4 (Flipped vertically)
5
(Rotated 90 degrees counterclockwise and flipped vertically)
6 (Rotated 90 degrees counterclockwise)
7
(Rotated 90 degrees clockwise and flipped vertically)
8 (Rotated 90 degrees clockwise)
Note  Photos that were inserted using earlier versions of FileMaker Pro are not automatically oriented; for such photos, not applied is appended to the result. For example, 3 (Rotated 180 degrees), not applied.
text
created
The earliest available timestamp for the photo.
timestamp
modified
The latest available timestamp for the photo. If the photo has never been modified, an empty string is returned.
timestamp
latitude
The latitude of the location of the photo.
text
longitude
The longitude of the location of the photo.
text
make
The manufacturer of the camera used for the photo.
text
model
The camera model used for the photo.
text
 
 
 
Audio
 
 
 
Note  Only MP3 and M4A files return results.
 
title
The title of the audio.
text
artist
The name of the performer of the audio.
text
album
The name of the album containing the audio.
text
year
The year the audio was released.
text
track
The track number and count of the audio. For example, 3/12, or 3 if the track count is not available.
text
genre
The genre of the audio.
text
composer
The composer of the audio.
text
coverArt
An image of the album cover.
container
duration
The duration of the audio. For example, 0:03:16.
time
bitRate
The number of kilobits per second (kbps) used in the audio.
number
 
 
 
Bar Codes
 
 
barcodeText
The contents of the bar code.
text
barcodeType
The type of the bar code.
text
 
 
 
Signatures
 
 
signed
The timestamp when the signature was inserted.
timestamp
 
 
 
Groups
 
 
general
Attributes listed in the General category above pertaining to the container field.
text
audio
Attributes listed in the Audio category above pertaining to the container field.
text
image
Attributes listed in the Images category above pertaining to the container field.
text
photo
Attributes listed in the Photos category above pertaining to the container field.
text
barcode
Attributes listed in the Bar Codes category above pertaining to the container field.
text
signature
Attributes listed in the Signatures category above pertaining to the container field.
text
all
Attributes in all the categories listed above pertaining to the container field.
text
Notes 
The internalSize can be much smaller than the fileSize (for example, container fields set up for open or secure storage, file references, or compressed files) or much larger than the fileSize (for example, container fields created by plug-ins).
Using the attribute MD5 allows you to prevent the insertion of duplicated files into a container field regardless of the filename.
Bar codes and signatures are not considered images.
For the group attributes general, audio, image, photo, and all, attributes are displayed in the format attributeName: attributeValue with one attribute per line. Some attributes are displayed differently in order to fit the attribute on one line:
externalFiles. Displays only the number of external files.
transparency. Displays 1 (True) or 0 (False).
coverArt. Displays png or jpg depending on the type of image.
bitRate. Displays kbps after the number. If an audio uses a variable bit rate, (VBR) is appended to the result. For example: Bit Rate: 247 kbps (VBR).
year. Date information may be returned in parentheses after the year. For example: Year: 2019 (11/10/2019).
Each returned value, except that last, ends with a carriage return.
Examples 
Notice that the attributes in the following examples are enclosed in quotation marks.
GetContainerAttribute(Image;"all") returns:
[General]
Filename: IMG_003.JPG
Storage Type: Embedded
MD5: C35A3F668A1FB3F370969399A1FF04FE
File Size: 1964978
Internal Size: 1965064
External Size: 0
External Files: 0
 
[Image]
Width: 1936
Height: 2592
DPI Width: 72
DPI Height: 72
Transparency: 0 (False)
 
[Photo]
Orientation: 6 (Rotated 90 degrees counterclockwise)
Created: 1/14/2020 2:40:31 PM
Modified:
Latitude: 37.406167
Longitude: -121.983333
Make: Apple
Model: iPhone 5s
 
GetContainerAttribute(Product;"barcode") returns:
[Bar Code]
Bar Code Text: 875720001107
Bar Code Type: UPC-A
 
GetContainerAttribute(Package;"signature") returns:
[Signature]
Signed: 11/10/2019 11:41:22 AM
Related topics 
Functions reference (category list)
Functions reference (alphabetical list)
About formulas
About functions
Defining calculation fields
Using operators in formulas