fileAttachment 资源类型fileAttachment resource type

事件、邮件或帖子中附加的文件(例如文本文件或 Word 文档)。contentBytes 属性包含文件的 base64 编码内容。A file (such as a text file or Word document) attached to an event, message or post. The contentBytes property contains the base64-encoded contents of the file.

创建文件附件时,在请求正文中包括以下内容:When creating a file attachment, include the following in the request body:

  • "@odata.type": "#microsoft.graph.fileAttachment"
  • 必要属性名称contentBytesThe required properties name and contentBytes.

派生自 附件Derived from attachment.

方法Methods

方法Method 返回类型Return Type 说明Description
GetGet fileAttachmentfileAttachment 读取 fileattachment 对象的属性和关系。Read properties and relationships of fileAttachment object.
删除Delete None 删除 fileAttachment 对象。Delete fileAttachment object.

属性Properties

属性Property 类型Type 说明Description
contentBytescontentBytes BinaryBinary 文件的 Base64 编码内容。The base64-encoded contents of the file.
contentIdcontentId StringString 获取 Exchange 存储中的附件 ID。The ID of the attachment in the Exchange store.
contentLocationcontentLocation StringString 对应于附件内容所在位置的统一资源标识符 (URI)。The Uniform Resource Identifier (URI) that corresponds to the location of the content of the attachment.
contentTypecontentType StringString 附件的内容类型。The content type of the attachment.
idid StringString 附件 ID。The attachment ID.
isInlineisInline 布尔Boolean 如果是内嵌附件则设置为 true。Set to true if this is an inline attachment.
lastModifiedDateTimelastModifiedDateTime DateTimeOffsetDateTimeOffset 上次修改附件的日期和时间。The date and time when the attachment was last modified.
namename StringString 表示显示在表示嵌入的附件的图标下方的文本的名称。该名称不必是实际的文件名。The name representing the text that is displayed below the icon representing the embedded attachment.This does not need to be the actual file name.
sizesize Int32Int32 附件大小,以字节为单位。The size in bytes of the attachment.

RelationshipsRelationships

None

JSON 表示形式JSON representation

下面是资源的 JSON 表示形式。Here is a JSON representation of the resource

{
  "contentBytes": "binary",
  "contentId": "string",
  "contentLocation": "string",
  "contentType": "string",
  "id": "string (identifier)",
  "isInline": true,
  "lastModifiedDateTime": "String (timestamp)",
  "name": "string",
  "size": 1024
}