# Function fileSetExtension (file, ext)

>**fileSetExtension**(file, ext)
- Add ext to the file name if non exist else replace the extension with the new one

- See [Functions](../functions.md)

## Parameters

| Parameter |Type |Default |Description |
|  ---- | ---- | ---- | ---- |
**file** |string | |The filename |
**ext** |string |'' |The extension |
