com.HTTPPart.getAttachment

Returns the absolute path to the HTTP part.

Syntax

getAttachment()
  RETURNING filename STRING

Usage

Returns the absolute path location of the received part file.

The file is created in the temporary directory used by the runtime system (DBTEMP). The name of the file will be the basename found in the HTTP Content-Disposition Header, if this basename is not specified, the filename will be created with a UUID. If a file with the same name already exists in the temporary directory, the API prefixes the new file with a number. It is then of the form : /tmp/ABC/filename_index.ext, where index represents the number of files with the same name on disk.

If the file is encoded in base64, you can use the Genero Web Services fglpass -dec64 command to convert it back to binary.

It is up to programmer to remove file from the disk when it is no longer needed.

To be used via methods: com.HTTPResponse.getPart, com.HTTPResponse.getPartCount, and com.HTTPResponse.getPartFromContentID

In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).