> ## Documentation Index
> Fetch the complete documentation index at: https://intunedhq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# FileType

A union type representing different file formats that can be processed by the SDK.

Provides flexibility in how files can be passed to various functions, supporting multiple input formats.

```typescript theme={null}
export type FileType = Download | Uint8Array | Buffer | ReadStream;
```

## Examples

```typescript Using Download Object theme={null}
import { downloadFile, uploadFileToS3 } from "@intuned/browser";
export default async function handler(params, page, context) {
  // From a browser download
  const download = await downloadFile({
    page,
    trigger: "https://example.com/file.pdf",
  });
  const uploaded = await uploadFileToS3({
    file: download,
    configs: s3Config,
  });
}
```

```typescript Using Buffer theme={null}
import { uploadFileToS3 } from "@intuned/browser";
export default async function handler(params, page, context) {
  // From raw buffer
  const fileBuffer = Buffer.from("PDF content here...", "utf8");
  const uploaded = await uploadFileToS3({
    file: fileBuffer,
    fileNameOverride: "generated.pdf",
    configs: s3Config,
  });
}
```

```typescript Using ReadStream theme={null}
import { uploadFileToS3 } from "@intuned/browser";
import { createReadStream } from "fs";
export default async function handler(params, page, context) {
  // From a file stream
  const fileStream = createReadStream("/path/to/document.pdf");
  const uploaded = await uploadFileToS3({
    file: fileStream,
    fileNameOverride: "renamed.pdf",
    configs: s3Config,
  });
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.