JDBC Driver for Microsoft Office 365

Build 25.0.9434

DownloadAttachments

Downloads one or more attachments from a specified email message.

Input

Name Type Required Accepts Output Streams Description
MessageId String True False Identifier of the email message from which attachments should be downloaded.
UserId String False False Identifier of the user account. This is required only if the authenticated user is an administrator performing actions on behalf of another user.
AttachmentId String False False Identifier of a specific attachment to download. If not specified, all attachments from the message are returned.
DownloadTo String False False Destination path where the attachments are saved. If not specified, the content bytes are returned directly. Required when MessageId is provided.
Encoding String False False Specifies the encoding type used for the FileData input, such as Base64.

The allowed values are NONE, BASE64.

The default value is BASE64.

FileStream String False True Output stream where the attachment data is written if DownloadTo is not specified.

Result Set Columns

Name Type Description
Id String Identifier of the downloaded attachment.
Name String File name of the downloaded attachment.
ContentBytes String Raw content bytes of the downloaded attachment.
LastmodifiedDatetime String Timestamp indicating when the attachment was last modified.
ContentType String The content type of the attachment. If DownloadTo is specified, this value is null.
FileData String Encoded file content returned as output. Used only if DownloadTo and FileStream are not specified.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434