Set PodeResponseAttachment - mdaneri/Pode GitHub Wiki
external help file: Pode-help.xml Module Name: Pode online version: PodeType: Responses schema: 2.0.0
Attaches a file onto the Response for downloading.
Set-PodeResponseAttachment [-Path] <String> [-ContentType <String>] [-EndpointName <String>] [-FileBrowser]
[-ProgressAction <ActionPreference>] [<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 inferring 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: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOptional EndpointName that the static route was creating under.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf the path is a folder, instead of returning 404, will return A browsable content of the directory.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe 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{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.