Reference > Script steps reference > Files script steps > Get File Size
 

Get File Size

Returns the size, in bytes, of a file.

See also 

Options 

Source file is the path of the file to check. See Creating file paths.

Target is the field or variable to store the result. If the variable doesn't exist, this script step creates it (see Using variables).

Compatibility 

 

Product 

Supported 

FileMaker Pro Advanced 

Yes 

FileMaker Go 

Yes 

FileMaker WebDirect 

No 

FileMaker Server 

Yes 

FileMaker Cloud for AWS 

Yes 

FileMaker Data API 

Yes 

Custom Web Publishing 

Yes 

Runtime solution 

No 

Originated in 

FileMaker Pro 18.0 Advanced

Example 1 

Sets the Table::Data field to 42 if the 42-byte file named data.txt exists.

Get File Size [ "data.txt" ; Target: Table::Data ]

Example 2 

Checks whether a file named change.log exists in the Documents folder, and if it does, displays the file size.

Set Variable [ $file; Value: Get ( DocumentsPath ) & "change.log" ]
Get File Exists [ "$file" ; Target: $fileExists ]
If [ $fileExists ]
Get File Size [ "$file" ; Target: $fileSize ]
Show Custom Dialog [ "File size (bytes): " & $fileSize ]
Else
Show Custom Dialog [ $file & ": Doesn't exist." ]
End If

Related topics 

Script steps reference (alphabetical list)

Script steps reference (category list)