• Home
  • API Documentation

Class FileAttachment

Represents an attachment to a GroupMe Message containing an image.

Inheritance
Object
Attachment
FileAttachment
Namespace: GroupMeClientApi.Models.Attachments
Assembly: GroupMeClientApi.dll
Syntax
public class FileAttachment : Attachment

Properties

| Improve this Doc View Source

DefaultUploadBlockSize

Gets the default buffer size, in bytes, used for uploading content.

Declaration
public static int DefaultUploadBlockSize { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Id

Gets the URL of the image attachment.

Declaration
public string Id { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Type

Gets the attachment type.

Declaration
public override string Type { get; }
Property Value
Type Description
String
Overrides
Attachment.Type

Methods

| Improve this Doc View Source

CreateFileAttachment(String, Byte[], IMessageContainer, CancellationTokenSource, UploadProgress)

Uploads a document to GroupMe and returns the created FileAttachment.

Declaration
public static Task<FileAttachment> CreateFileAttachment(string filename, byte[] document, IMessageContainer messageContainer, CancellationTokenSource cancellationTokenSource = null, UploadProgress uploadProgress = null)
Parameters
Type Name Description
String filename

The name of the file being sent.

Byte[] document

The document to upload.

IMessageContainer messageContainer

The IMessageContainer that the message is being sent to.

CancellationTokenSource cancellationTokenSource

The cancellation source to use for the upload operation.

UploadProgress uploadProgress

A monitor that will receive progress updates for the file upload operation.

Returns
Type Description
Task<FileAttachment>

An ImageAttachment if uploaded successfully, null otherwise.

| Improve this Doc View Source

DownloadFileAsync(Message)

Gets a download URL for this FileAttachment.

Declaration
public Task<byte[]> DownloadFileAsync(Message message)
Parameters
Type Name Description
Message message

The message that contains the FileAttachment.

Returns
Type Description
Task<Byte[]>

A download URL string.

| Improve this Doc View Source

GetFileData(Message)

Retrieves information about this FileAttachment from GroupMe.

Declaration
public Task<FileAttachment.FileData> GetFileData(Message message)
Parameters
Type Name Description
Message message

The Message that the file is contained in.

Returns
Type Description
Task<FileAttachment.FileData>

An FileAttachment.FileData if data is retrieved successfully, null otherwise.

  • Edit on GitHub
  • View on GitHub
Back to top Generated by DocFX