> For the complete documentation index, see [llms.txt](https://docs.17movement.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.17movement.net/phone/exports/gallery/server-exports.md).

# SERVER EXPORTS

<details>

<summary>GalleryMedia Structure</summary>

```
{
  "id": 123,
  "type": "image",
  "url": "[https://example.com/image.jpg](https://example.com/image.jpg)",
  "thumbnail": "[https://example.com/thumb.jpg](https://example.com/thumb.jpg)",
  "favorite": false,
  "albumId": null,
  "createdAt": 1678900000
}
```

</details>

### Save Media (By Source)

Saves a photo or video to the player's gallery using their Server ID (Source).

{% code overflow="wrap" lineNumbers="true" %}

```lua
local result = exports["17mov_Phone"]:Gallery_SaveMediaBySrc(src, type, url)
```

{% endcode %}

**Returns:**

* `table`: `{ success: boolean, data: GalleryMedia }`

<table><thead><tr><th width="123" align="center">Argument</th><th width="140" align="center">Type</th><th width="107" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center">❌</td><td>The player's server ID (source).</td></tr><tr><td align="center">type</td><td align="center"><code>photo | video</code></td><td align="center">❌</td><td>Type of media</td></tr><tr><td align="center">url</td><td align="center"><code>string</code></td><td align="center">❌</td><td>Direct URL to the image or video file.</td></tr></tbody></table>

### Save Media (By Number)

Saves a photo or video to the player's gallery using their phone number.

{% code overflow="wrap" lineNumbers="true" %}

```lua
local result = exports["17mov_Phone"]:Gallery_SaveMediaByNumber(number, type, url)
```

{% endcode %}

**Returns:**

* `table`: `{ success: boolean, data: GalleryMedia }`

<table><thead><tr><th width="118" align="center">Argument</th><th width="140" align="center">Type</th><th width="107" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">number</td><td align="center"><code>number</code></td><td align="center">❌</td><td>The player's phone number.</td></tr><tr><td align="center">type</td><td align="center"><code>photo | video</code></td><td align="center">❌</td><td>Type of media</td></tr><tr><td align="center">url</td><td align="center"><code>string</code></td><td align="center">❌</td><td>Direct URL to the image or video file.</td></tr></tbody></table>

### Delete Media (By Source)

Deletes specific media from the player's gallery using their Server ID (Source).

{% code overflow="wrap" lineNumbers="true" %}

```lua
local success = exports["17mov_Phone"]:Gallery_DeleteMediaBySrc(src, mediaId)
```

{% endcode %}

**Returns:**

* `boolean`: `true` if deletion was successful.

<table><thead><tr><th width="118" align="center">Argument</th><th width="188" align="center">Type</th><th width="105" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center">❌</td><td>The player's server ID (source).</td></tr><tr><td align="center">mediaId</td><td align="center"><code>number | number[]</code></td><td align="center">❌</td><td>The id of media</td></tr></tbody></table>

### Delete Media (By Number)

Deletes specific media from the player's gallery using their phone number.

{% code overflow="wrap" lineNumbers="true" %}

```lua
local success = exports["17mov_Phone"]:Gallery_DeleteMediaByNumber(src, mediaId)
```

{% endcode %}

**Returns:**

* `boolean`: `true` if deletion was successful.

<table><thead><tr><th width="118" align="center">Argument</th><th width="188" align="center">Type</th><th width="105" align="center">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center">❌</td><td>The player's phone number.</td></tr><tr><td align="center">mediaId</td><td align="center"><code>number | number[]</code></td><td align="center">❌</td><td>The id of media</td></tr></tbody></table>

### Fetch All Media (By Source)

Retrieves all media items from a player's gallery using their Server ID (Source).

{% code overflow="wrap" lineNumbers="true" %}

```lua
local mediaList = exports["17mov_Phone"]:Gallery_FetchAllMediaBySrc(src)
```

{% endcode %}

**Returns:**

* `GalleryMedia[]`: An array of media objects.

<table><thead><tr><th width="125" align="center">Argument</th><th width="121" align="center">Type</th><th width="110" align="center" valign="top"></th><th></th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center" valign="top">❌</td><td>The player's server ID (source).</td></tr></tbody></table>

### Fetch All Media (By Number)

Retrieves all media items from a player's gallery using their phone number.

{% code overflow="wrap" lineNumbers="true" %}

```lua
local mediaList = exports["17mov_Phone"]:Gallery_FetchAllMediaByNumber(number)
```

{% endcode %}

**Returns:**

* `GalleryMedia[]`: An array of media objects.

<table><thead><tr><th width="125" align="center">Argument</th><th width="121" align="center">Type</th><th width="110" align="center" valign="top">Optional</th><th>Explanation</th></tr></thead><tbody><tr><td align="center">src</td><td align="center"><code>number</code></td><td align="center" valign="top">❌</td><td>The player's phone number.</td></tr></tbody></table>


---

# 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://docs.17movement.net/phone/exports/gallery/server-exports.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.
