> For the complete documentation index, see [llms.txt](https://mostafaznv.gitbook.io/larupload/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mostafaznv.gitbook.io/larupload/meta.md).

# Meta

The `meta` method in Larupload is used to retrieve meta information about an attachment. This method can provide various types of information, such as the `originalName`, `size,` `type`, `mimeType`, `duration`, `width`, `height`, and `dominantColor` of the uploaded file. The method takes an optional argument that specifies which specific piece of meta information is to be retrieved. If no argument is provided, the method returns all available meta information for the attachment.

For example, to retrieve the size of an attachment named "file", you can use the following code:

```php
$size = $model->attachment('file')->meta('size');
```

Similarly, to retrieve the MIME type of the same attachment, you can use the following code:

```php
$mime = $model->attachment('file')->meta('mime_type');
```

If you want to retrieve all available meta information for the attachment, you can simply call the `meta` method without any arguments, like this:

```php
$meta = $model->attachment('file')->meta();
```

{% code title="Output" %}

```json
{
    "name": "9e55cf595703eaa109025073caed65a4.jpg",
    "id": "1",
    "original_name": "image.jpg",
    "size": 35700,
    "type": "IMAGE",
    "mime_type": "image/jpeg",
    "width": 1077,
    "height": 791,
    "duration": null,
    "dominant_color": "#f4c00a",
    "format": "jpg",
    "cover": "9e55cf595703eaa109025073caed65a4.jpg"
  }
```

{% endcode %}

{% hint style="info" %}
It's important to note that the `type` field returned by the `meta` object is based on the file extension, and not on the actual contents of the file.

Here are some more details about each type:

* IMAGE: for files with extensions like jpg, png, gif, bmp, etc.
* VIDEO: for files with extensions like mp4, avi, mov, wmv, etc.
* AUDIO: for files with extensions like mp3, wav, ogg, etc.
* DOCUMENT: for files with extensions like doc, docx, pdf, ppt, pptx, xls, xlsx, etc.
* COMPRESSED: for files with extensions like zip, rar, 7z, etc.
* FILE: for all other file types that don't fall into the above categories.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mostafaznv.gitbook.io/larupload/meta.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
