We have solved this problem by outputting the attachment to file on the server, then using the primitive DownloadFile to get the file onto the client. It is listed on the HAL Primitives site as "Not used any more" but hopefully it will remain available in future versions.