---
title: "Attachments"
description: "Learn more about how Sentry can store additional files in the same request as event attachments."
url: https://docs.sentry.io/platforms/godot/enriching-events/attachments/
---

# Attachments | Sentry for Godot Engine

Sentry can enrich your events for further investigation by storing additional files, such as config or log files, as attachments.

## [Creating Attachments](https://docs.sentry.io/platforms/godot/enriching-events/attachments.md#creating-attachments)

The simplest way to create an attachment is to use a `path`. The SDK will read the contents of the file each time it prepares an event or transaction, then adds the attachment to the same [envelope](https://develop.sentry.dev/sdk/data-model/envelopes/). If the SDK can't read the file, the SDK logs an error message and drops the attachment.

```GDScript
var attachment := SentryAttachment.create_with_path("user://logs/godot.log")
attachment.content_type = "text/plain"
```

Alternately, use `bytes` to initialize an attachment. When doing so, you also need to specify a filename.

```GDScript
var bytes: PackedByteArray = "Hello, world!".to_ascii_buffer()
var attachment := SentryAttachment.create_with_bytes(bytes, "hello.txt")
attachment.content_type = "text/plain"
```

##### Note

If your SDK supports offline caching, which is typical for mobile, each attachment is stored to disk for each event or transaction you capture when the device is offline. When using large attachments, this storage can consume the disk space if the device is offline for a longer time period.

In addition, you can set these parameters:

`filename`

The filename is the name of the file to display in Sentry. When using bytes you have to specify a filename, whereas with a path you don't as the SDK is going to use the last path component.

`content_type`

The specific media content type that determines how the attachment is rendered in the Sentry UI. Any [MIME type](https://www.iana.org/assignments/media-types/media-types.xhtml) may be used; the default is `application/octet-stream`.

We currently support and can render the following MIME types:

* `text/plain`
* `text/css`
* `text/csv`
* `text/html`
* `text/javascript`
* `text/json` or `text/x-json` or `application/json` or `application/ld+json`
* `image/jpeg`
* `image/png`
* `image/gif`

## [Uploading Attachments](https://docs.sentry.io/platforms/godot/enriching-events/attachments.md#uploading-attachments)

You can add attachments that will be sent with every event using `SentrySDK.add_attachment()`.

```GDScript
# Global scope
var attachment := SentryAttachment.create_with_path("user://logs/godot.log")
attachment.content_type = "text/plain"
SentrySDK.add_attachment(attachment)
```

You can also add attachments inside the `SentrySDK.init()` configuration callback. This is useful when you want to register attachments as part of SDK setup:

```GDScript
SentrySDK.init(func(options: SentryOptions) -> void:
	# Add attachment during initialization.
	var att := SentryAttachment.create_with_path("user://logs/godot.log")
	att.content_type = "text/plain"
	SentrySDK.add_attachment(att)
)
```

To clear all user-added attachments, use `SentrySDK.clear_attachments()`. Built-in attachments such as log files, screenshots, and view hierarchy are preserved.

```GDScript
SentrySDK.clear_attachments()
```

Sentry allows at most 40MB for a compressed request, and at most 200MB of uncompressed attachments per event, including the crash report file (if applicable). Uploads exceeding this size are rejected with HTTP error `413 Payload Too Large` and the data is dropped immediately. To add larger or more files, consider secondary storage options.

Attachments are saved for 30 days. Newly submitted attachments will not be stored if your total storage quota has been exceeded. You can delete attachments or their containing events at any time. Deleting an attachment does not affect your quota - Sentry counts an attachment toward your quota as soon as it is stored.

Learn more about how attachments impact your [quota](https://docs.sentry.io/pricing/quotas.md).

### [Access to Attachments](https://docs.sentry.io/platforms/godot/enriching-events/attachments.md#access-to-attachments)

To limit access to attachments, navigate to your organization's **General Settings**, then select the *Attachments Access* dropdown to set appropriate access — any member of your organization, the organization billing owner, member, admin, manager, or owner.

By default, access is granted to all members when storage is enabled. If a member does not have access to the project, the ability to download an attachment is not available; the button will be greyed out in Sentry. The member may only view that an attachment is stored.

## [Store Minidumps as Attachments](https://docs.sentry.io/platforms/godot/enriching-events/attachments.md#store-minidumps-as-attachments)

[Minidumps](https://docs.sentry.io/platforms/native/guides/minidumps.md#what-is-a-minidump) may contain sensitive information about the target system, such as environment variables, local pathnames, or in-memory representations of input fields, including passwords. By default, Sentry only uses minidump files to create events and immediately drops them. All sensitive information is stripped from the resulting events.

All attachments types, including log files, screenshots and minidumps (if you enable Store Minidumps As Attachments), are stored for 30 days when sent to Sentry. Note that Sentry does not apply data scrubbing to attachments.

☝ This feature is supported on Windows, Linux, and Android.

### [Enabling Minidump Storage](https://docs.sentry.io/platforms/godot/enriching-events/attachments.md#enabling-minidump-storage)

You can enable *Store Minidumps As Attachments* in your organization or project settings under **Security & Privacy**. By default, this setting is disabled. Determine the maximum number of crash reports that will be stored per issue; disabled, unlimited, or maximum per issue:

If you set a limit per issue, as in the example above, a limit of 5, Sentry will store the first 5 attachments associated with this issue, but drop any that follow. To make room for additional attachments, delete them. Sentry will then accept attachments until the limit is reached again.

## [Viewing Attachments](https://docs.sentry.io/platforms/godot/enriching-events/attachments.md#viewing-attachments)

Attachments display on the bottom of the **Issue Details** page for the event that is shown.

Alternately, attachments also appear in the *Attachments* tab on the **Issue Details** page, where you can view the *Type* of attachment, as well as associated events. Click the Event ID to open the **Issue Details** of that specific event.
