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

# attachmentTypeFor

```typescript
attachmentTypeFor(declaredType: string, filename: string): "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "application/pdf" | "text/plain" | "text/csv" | "application/json" | "image/heic" | "image/heif" | null
```

The allowed type for a file: its declared type when allowed, otherwise the type its extension
names, otherwise null. The server also checks the bytes.

## Parameters

<ResponseField name={"declaredType"} type={"string"} required />

<ResponseField name={"filename"} type={"string"} required />

## Returns

`"image/png" | "image/jpeg" | "image/gif" | "image/webp" | "application/pdf" | "text/plain" | "text/csv" | "application/json" | "image/heic" | "image/heif" | null`


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