# AddFile
**EventNames:**
- AddFile_Restrictions
- AddFile_Pre
- AddFile_Post
**Parameters**
| Type | Name | Description |
| ------------------------------------------------------------------ | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [File](powervault:code_reference/objects/file) | file | The file which is / was added.
**Restrictions and Pre:**
In *Restrictions* and *Pre* you have only very limited data set on this object like `_NewName`, `_NewComment`, `_NewModDate`, `_NewClassification` and `_NewHidden`, because the file does not exist yet.
**Post:**
In *Post* its a usualy powerVaultFile object, because here the file exists. |
| [Folder](powervault:code_reference/objects/folder) | parentFolder | The folder where the new file is located. |
| [File[]](powervault:code_reference/objects/file) | dependencies | The file dependencies what this new file has. |
| [File[]](powervault:code_reference/objects/file) | attachments | The attached files what this new file has. |
| [FileBomRow[]](powervault:code_reference/objects/filebomrow) | fileBom | The bill of materials to associate with the file. |
| bool | successful | **Post**:
The information whether the Web Service call was successful or not is only available in *Post* events. |
**Examples:**\
AddFile_Restrictions:
```PowerShell
Register-VaultEvent -EventName AddFile_Restrictions -Action 'RestrictAddFile'
function RestrictAddFile($file, $parentFolder, $dependencies, $attachments, $fileBom) {
#Write event code here
}
```
AddFile_Pre:
```PowerShell
Register-VaultEvent -EventName AddFile_Pre -Action 'PreAddFile'
function PreAddFile($file, $parentFolder, $dependencies, $attachments, $fileBom) {
#Write event code here
}
```
AddFile_Post:
```PowerShell
Register-VaultEvent -EventName AddFile_Post -Action 'PostAddFile'
function PostAddFile($file, $parentFolder, $dependencies, $attachments, $fileBom, $successful) {
#Write event code here
}
```