get-mime-content-disposition-param

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  Expression Functions > MIME Expression Functions >

get-mime-content-disposition-param

Returns the parameter param from the "Content-Disposition" header of a stream if such header and parameter exists; otherwise, it returns the value of the default argument. This function can be used to receive messages that follow the optional AS2 profile FileName preservation (FN) to extract the original file name from the MIME header.

 

Signature

get-mime-content-disposition-param(s:stream, param:string, default:string="") -> string

 

Parameters

Name

Type

Description

s

stream

Specifies the input stream.

param

string

Specifies the name of the parameter to return.

default

string

Specifies the value to return when the specified param and header do not exist. By default, this is an empty string.

 

Examples

Assuming that stream msg contains the header Content-Disposition: attachment; filename="GETMSG.edi", the following expression will return "GETMSG.edi":

 

mime-get-content-disposition-param(msg, "filename")


© 2019 Altova GmbH