# Upload nhiều ảnh

Nếu bạn muốn upload nhiều ảnh trong một Folder thì đây là một script để bạn có thể tham khảo.

Đầu tiên ta có một folder chứa các ảnh mà bạn muốn upload:

<figure><img src="/files/HqAz79rjtH5uL3iOrB4m" alt=""><figcaption></figcaption></figure>

Tại đường dẫn thư của folder bạn nhập **cmd** và nhấn **Enter**

<figure><img src="/files/qbKAod7vzhGrN7D55BiU" alt=""><figcaption></figcaption></figure>

Bảng điều khiển cmd hiện hiện lên, và gõ lệnh:   **dir /B /S>FolderList.txt** và lệnh                          **echo x>>FolderList.txt**   và nhấn Enter

<figure><img src="/files/m9nk5toMkRwLsoY4ssJ4" alt=""><figcaption></figcaption></figure>

Sau đó một file txt có tên là FolderList chứa đường dẫn của tất cả các ảnh trong folder được tạo:

<figure><img src="/files/eBUpcfXz6t5QtDBNavW6" alt=""><figcaption></figcaption></figure>

Mở file txt đó lên và xóa dòng đầu tiên của file và lưu file lại, chính là dòng chưa đường dẫn của Folder, dòng chứa chữ x bạn phải giữ lại, khi đọc file đến dòng đó có nghĩa là đã upload hết ảnh:

<figure><img src="/files/EclhWC5ecSpk84cR1G8c" alt=""><figcaption></figcaption></figure>

Ta có Script như sau: Ta sẽ thực hiện upload ảnh lên lightShot:&#x20;

<figure><img src="/files/Jz9LZmH3TuoioXvbWdys" alt=""><figcaption></figcaption></figure>

Trong script này:

* Node read file bạn hãy chọn file FolderList.txt, và chọn type là Line by line để đọc từng dùng từ trên xuống, khi đọc xong thì sẽ lưu giá trị vào biến file\_anh

<figure><img src="/files/u3GSZV1TWL8Tn7WGbHnY" alt=""><figcaption></figcaption></figure>

* Node if ta sẽ so sánh nếu giá trị của biến file\_anh bằng x thì có nghĩa là đã đọc xong file, đã upload hết ảnh. Nếu file\_anh mà không bằng x có nghĩa là chưa upload hết ảnh trong folder, thì ta sẽ thực hiện upload ảnh tiếp.

<figure><img src="/files/Fd5i7Mt8I2ceqCVnoCn8" alt=""><figcaption></figcaption></figure>

* Node File choose event ta sẽ chọn biến file\_anh tại trường path to the file

<figure><img src="/files/FMTreKlmM2jafpaJiw0g" alt=""><figcaption></figcaption></figure>

* Node click ta sẽ thực hiện click để uplaod ảnh

Dưới đây là script mẫu:

{% file src="/files/NiYbhWeEd8PktEofUruC" %}


---

# 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://docs.hidemium.io/automation-user-manual/scripts/upload-nhieu-anh.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.
