# uploadMedia()

uploadMedia() is there to help you upload images and videos to Twitter easily\
\
\ <br>

```bash
options :

alt_text: alt text(required)
tweet_message: a tweet message (optional)
```

## uploading using a file in the system

```
bot.uploadMedia('path/to/file.png', {... here are the options ... })
```

{% hint style="info" %}
include the option tweet\_message to send a tweet with the image attached
{% endhint %}

## Sending a image/vid from a Url&#x20;

You can use this to upload images that are not on the system but hosted on a website\
the link should be a valid link like this <https://www.google.com/images/srpr/logo10w.png>\
\ <br>

```
bot.uploadMedia('https://www.google.com/images/srpr/logo10w.png', {options here})
```

this would out put something similar to this \ <br>

```
✔️--finished downloading!
[Node-tweet]-Posting your downloaded images
```


---

# Agent Instructions: 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:

```
GET https://seoden2136.gitbook.io/tweet-js/methods/uploadmedia.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
