Show / Hide Table of Contents

# Class Attachment

Represents a message attachment found in a IUserMessage.

##### Inheritance

System.Object
Attachment

##### Implements

IAttachment

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Discord

###### Assembly: Discord.Net.Rest.dll

##### Syntax

    public class Attachment : IAttachment

### Properties

| Improve this Doc View Source

#### Filename

Gets the filename of this attachment.

##### Declaration

    public string Filename { get; }

##### Property Value

Type | Description
--- | ---
System.String | A string containing the full filename of this attachment (e.g. `textFile.txt`).

| Improve this Doc View Source

#### Height

Gets the height of this attachment.

##### Declaration

    public int? Height { get; }

##### Property Value

Type | Description
--- | ---
System.Nullable<System.Int32> | The height of this attachment if it is a picture; otherwise `null`.

| Improve this Doc View Source

#### Id

Gets the ID of this attachment.

##### Declaration

    public ulong Id { get; }

##### Property Value

Type | Description
--- | ---
System.UInt64 | A snowflake ID associated with this attachment.

| Improve this Doc View Source

#### ProxyUrl

Gets a proxied URL of this attachment.

##### Declaration

    public string ProxyUrl { get; }

##### Property Value

Type | Description
--- | ---
System.String | A string containing the proxied URL of this attachment.

| Improve this Doc View Source

#### Size

Gets the file size of this attachment.

##### Declaration

    public int Size { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 | The size of this attachment in bytes.

| Improve this Doc View Source

#### Url

Gets the URL of this attachment.

##### Declaration

    public string Url { get; }

##### Property Value

Type | Description
--- | ---
System.String | A string containing the URL of this attachment.

| Improve this Doc View Source

#### Width

Gets the width of this attachment.

##### Declaration

    public int? Width { get; }

##### Property Value

Type | Description
--- | ---
System.Nullable<System.Int32> | The width of this attachment if it is a picture; otherwise `null`.

### Methods

| Improve this Doc View Source

#### ToString()

Returns the filename of this attachment.

##### Declaration

    public override string ToString()

##### Returns

Type | Description
--- | ---
System.String | A string containing the filename of this attachment.

##### Overrides

System.Object.ToString()

### Implements

IAttachment