# GetTempFile()

Creates a temporary file in a directory whose name starts with
(at most) the first three characters of prefix.

```
GetTempFile( dir=string, prefix=string, extension=string );
```

**Returns:** string

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| dir | string | No | Directory name, defaults to getTempDirectory() since 6.2.1.19 |  |
| prefix | string | Yes | Prefix of a temporary file to create in the dir directory |  |
| extension | string | No | Extension for the temporary file, default is .tmp *Alias: ext* |  |

# Examples

```cfml
 dump(GetTempFile(getTempDirectory(), "demo"));
```







# Categories

[File handling](../../categories/files.md)

# See Also

[GetTempDirectory()](gettempdirectory.md)