# Add-FLCAttachment Adds an Attachment to an existing Item in Fusion 360 Manage. ## Syntax ```powershell Add-FLCAttachment -Workspace -ItemId -Path [[-Title] ] [[-Description] ] [] ``` ```powershell Add-FLCAttachment -InputObject -Path [[-Title] ] [[-Description] ] [] ``` | Type | Name | Description | Optional | | -------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | | String | Workspace | The name of the workspace that contains the Item | no (optional when *InputObject* is used) | | Long | ItemId | The ID of the Item for which the attachment should be added | no (optional when *InputObject* is used) | | [Item]() | InputObject | The Fusion 360 Manage Item for which the attachment should be added. The argument accepts pipeline input | no (optional when *Workspace* and *ItemId* are used) | | [FileInfo]() | Path | The Path to the file which should be uploaded and attached to the item. | no | | String | Title | The title to use for the attachment. If no title is provided, the filename without extension will be used. | yes | | String | Description | A description for the uploaded attachment | yes | ## Return type [Attachment]() ← on success.\ **empty** ← on failure. Exception/ErrorMessage can be accessed using [\$Error](). ## Remarks The cmdlet supports passing all versions of an item.\ This means that for a *revision-controlled* workspace, an attachment can be added not only to *working versions* but also to the *latest versions* of an item. The **-Path** arguments accepts all file types to be uploaded as attachment although only specific file types can be viewed with the Viewer in Fusion 360 Manage.\ A list of the file types that can be viewed in Fusion 360 Manage can be found [here](). When an attachment with the same *Title* already exists on the item *a new version* of the attachment is added.\ Optionally with the **-Title** argument you can upload the same attachment using a different title. ## Examples To use the examples below a [Fusion 360 Manage demo]() Tenant is required: **Add an Attachment to an Item** ```powershell Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com' $attachment = Add-FLCAttachment -Workspace 'Products' -ItemId 8684 -Path 'C:\Temp\Injection Molding Machine.dwf' ``` **Add an Attachment using a specific title** ```powershell Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com' $item = (Get-FLCItems -Workspace 'Documents' -Filter '"Final Assembly Installation"')[0] $item | Add-FLCAttachment -Title 'Instructions' -Path '.\Documents\C300NO678S.pdf' -Description 'Documentation for Installation' <# Id : 470 ItemId : 8644 Workspace : Documents Title : Instructions FileName : C300NO678S.pdf Folder : Description : Documentation for Installation Size : 225659 Version : 1 #> ``` **Error handling, analyze why adding attachment failed using \$Error** ```powershell Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com' $attachment = Add-FLCAttachment -Workspace 'Suppliers' -ItemId 5839 -Path 'C:\Temp\Picture.png' if(-not $attachment){ $Error[0].Exception #Returns "FORBIDDEN: User ****: access ADD_ATTACHMENTS denied..." } ```