Attaches a file onto the Response for downloading.
Set-PodeResponseAttachment [-Path] <String> [[-ContentType] <String>] [[-EndpointName] <String>] [<CommonParameters>]
Attaches a file from the "/public", and static Routes, onto the Response for downloading. If the supplied path is not in the Static Routes but is a literal/relative path, then this file is used instead.
Set-PodeResponseAttachment -Path 'downloads/installer.exe'
Set-PodeResponseAttachment -Path './image.png'
Set-PodeResponseAttachment -Path 'c:/content/accounts.xlsx'
Set-PodeResponseAttachment -Path './data.txt' -ContentType 'application/json'
Set-PodeResponseAttachment -Path '/assets/data.txt' -EndpointName 'Example'
Manually specify the content type of the response rather than infering it from the attachment's file extension. The supplied value must match the valid ContentType format, e.g. application/json
Type: String Parameter Sets: (All) Aliases: Required: False Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False
Optional EndpointName that the static route was creating under.
Type: String Parameter Sets: (All) Aliases: Required: False Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False
The Path to a static file relative to the "/public" directory, or a static Route. If the supplied Path doesn't match any custom static Route, then Pode will look in the "/public" directory. Failing this, if the file path exists as a literal/relative file, then this file is used as a fall back.
Type: String Parameter Sets: (All) Aliases: Required: True Position: 1 Default value: None Accept pipeline input: True (ByValue) Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.