> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/huong-dan-cac-action/http/http-download.md).

# HTTP Download

HTTP Download là hành động nâng cao dùng để tải trực tiếp một tệp tin (như hình ảnh, video, file tài liệu, file zip...) từ một đường dẫn trực tuyến (URL) về lưu trữ trên máy tính của bạn mà không cần phải mở trình duyệt để nhấn nút Download thủ công.

#### Tham số cấu hình:

* URL: Địa chỉ đường dẫn trực tuyến dẫn thẳng đến tệp tin cần tải về (Ví dụ: `https://example.com/images/avatar.jpg`).
* Save Path: Đường dẫn tuyệt đối trên máy tính nơi bạn muốn lưu tệp tin sau khi tải về, bao gồm cả tên file và đuôi định dạng (Ví dụ: `D:\GPM_Data\downloads\avatar.jpg`).
* Headers: Thông tin bổ sung gửi kèm yêu cầu để xác thực quyền truy cập hoặc giả lập trình duyệt nếu máy chủ yêu cầu (Ví dụ: `User-Agent: Mozilla/5.0...` hoặc `Authorization: Bearer $token`). Nếu tải file công khai, bạn có thể để trống mục này.
* Output variable: Tên biến lưu kết quả trả về của hành động (thường trả về giá trị logic `True` nếu tải file thành công hoặc nội dung log phản hồi từ hệ thống).

#### Ví dụ thực tế: Tự động tải video từ đường dẫn có sẵn về máy tính

Giả sử bạn đang chạy một kịch bản cào bài viết và hệ thống đã trích xuất được một đường dẫn video trực tuyến lưu vào biến `$videoUrl`. Bạn muốn tải video này về một thư mục cố định trên ổ D để chuẩn bị cho các bước xử lý tiếp theo:

* Cách cấu hình:
  * URL: Truyền biến `$videoUrl` vào ô nhập liệu.
  * Save Path: Điền đường dẫn lưu file cụ thể, ví dụ: `D:\GPM_Data\Videos\downloaded_video.mp4`.
  * Headers: Để trống (nếu link tải công khai không cần tài khoản).
  * Output variable: Đặt tên biến lưu kết quả là `downloadStatus`.

Kết quả: Hệ thống sẽ tự động kết nối mạng, tải tệp tin video từ đường dẫn `$videoUrl` về và kết xuất thành một file vật lý tên là `downloaded_video.mp4` nằm gọn gàng tại thư mục `D:\GPM_Data\Videos\`. Biến `$downloadStatus` sẽ nhận giá trị để bạn có thể dùng khối lệnh If kiểm tra xem file đã tải xuống thành công hay chưa trước khi chuyển sang các hành động sau.

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


---

# 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.gpmautomate.com/huong-dan-cac-action/http/http-download.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.
