# FileSize Script function

The FileSize function returns an integer containing the size in bytes of the file filename or, if no filename is specified, of the table file currently being read.

Syntax:

FileSize([filename])

Arguments:

Arguments

| Argument | Description |
| --- | --- |
| filename | The name of a file, if necessary including path, as a folder or web file data connection If you don't specify a file name, the table file currently being read is used.<br><br>Example: 'lib://Table Files/'<br><br>In legacy scripting mode, the following path formats are also supported:<br><br><ul> <li> <p> absolute </p> <p><span><span>Example: </span></span><span>c:\data\</span> </p> </li> <li> <p>relative to the <span>Qlik Sense</span> application working directory.</p> <p><span><span>Example: </span></span><span>data\</span> </p> </li> <li> <p>URL address (<span>HTTP</span>  or <span>FTP</span>), pointing to a location on the Internet or an intranet. </p> <p><span><span>Example: </span></span><span>http://www.qlik.com</span> </p> </li> </ul> |

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/Scripting/FileFunctions/FileSize.htm)

#### Examples and results:

Scripting examples

| Example | Result |
| --- | --- |
| `LOAD  *, FileSize(<br>) as X from abc.txt;` | Will return<br>the size of the specified file (abc.txt) as an integer in field X in each<br>record read. |
| ` FileSize( 'lib://DataFiles/xyz.xls' )  ` | Will return the size of the file xyz.xls. |