# Class CreateFileRequest

Namespace
  AnthropicClient.Models

Assembly
  AnthropicClient.dll

Represents a request to create a file via the Anthropic Files API.

    public class CreateFileRequest

Inheritance
  object
  CreateFileRequest

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Constructors

### CreateFileRequest(byte[], string, string)

Initializes a new instance of the CreateFileRequest class.

    public CreateFileRequest(byte[] file, string fileName, string fileType)

#### Parameters

`file` byte[]

  The file content as a byte array.

`fileName` string

  The original filename of the file being uploaded.

`fileType` string

  The MIME type of the file.

#### Exceptions

ArgumentNullException

  Thrown when `file` is null.

ArgumentException

  Thrown when `fileName` or `fileType` is null or whitespace.

### CreateFileRequest(Stream, string, string)

Initializes a new instance of the CreateFileRequest class from a stream.

    public CreateFileRequest(Stream stream, string fileName, string fileType)

#### Parameters

`stream` Stream

  The stream containing the file content.

`fileName` string

  The original filename of the file being uploaded.

`fileType` string

  The MIME type of the file.

#### Exceptions

ArgumentNullException

  Thrown when `stream` is null.

ArgumentException

  Thrown when `fileName` or `fileType` is null or whitespace.

## Properties

### File

The file content as a byte array.

    public byte[] File { get; init; }

#### Property Value

byte[]

### FileName

The original filename of the file being uploaded.

    public string FileName { get; init; }

#### Property Value

string

### FileType

The MIME type of the file.

    public string FileType { get; init; }

#### Property Value

string