Table of Contents

Interface IAttachment

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

A list item attachment

public interface IAttachment : IDataModel<IAttachment>, IDataModelParent, IDataModelWithContext, ISupportModules<IAttachment>, IDataModelGet<IAttachment>, IDataModelUpdate, IDataModelDelete, IQueryableDataModel
Inherited Members
Extension Methods

Properties

All

A special property used to add an asterisk to a $select statement

object All { get; }

Property Value

object

FileName

Name of the attachment

string FileName { get; set; }

Property Value

string

FileNameAsPath

Name of the attachment as path

string FileNameAsPath { get; set; }

Property Value

string

ServerRelativePath

Server relative URL of the attachment as path

string ServerRelativePath { get; set; }

Property Value

string

ServerRelativeUrl

Server relative URL of the attachment

string ServerRelativeUrl { get; set; }

Property Value

string

Methods

GetContent(bool)

Get the content of this attachment.

Stream GetContent(bool streamContent = false)

Parameters

streamContent bool

Already return the content before all bytes are read, needed for large file downloads

Returns

Stream

Stream containing the binary content of the attachment

GetContentAsync(bool)

Get the content of this attachment.

Task<Stream> GetContentAsync(bool streamContent = false)

Parameters

streamContent bool

Already return the content before all bytes are read, needed for large file downloads

Returns

Task<Stream>

Stream containing the binary content of the attachment

GetContentBytes()

Get the content of the attachment.

byte[] GetContentBytes()

Returns

byte[]

The binary content of the attachment

GetContentBytesAsync()

Get the content of this attachment.

Task<byte[]> GetContentBytesAsync()

Returns

Task<byte[]>

The binary content of the attachment

Recycle()

Recycle this list attachment

void Recycle()

RecycleAsync()

Recycle this list attachment

Task RecycleAsync()

Returns

Task