# How to download files from the internet using gdscript?

**URL:** <https://forum.godotengine.org/t/how-to-download-files-from-the-internet-using-gdscript/8163>\
**Category:** Archive\
**Created:** [September 23, 2021, 10:41pm UTC](https://forum.godotengine.org/t/how-to-download-files-from-the-internet-using-gdscript/8163 "2021-09-23T22:41:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![system](https://forum.godotengine.org/uploads/default/original/2X/4/4b0a7fa8a6334634b94a13d421f0d99e6f04e21f.svg) [@system](https://forum.godotengine.org/u/system)\
**Post date:** [September 23, 2021, 11:02pm UTC](https://forum.godotengine.org/t/how-to-download-files-from-the-internet-using-gdscript/8163/2 "2021-09-23T23:02:45Z")

</div>

| | | |
| --- | --- | --- |
| 👤 | **Reply From:** | Wakatta |

You need nothing more than to make an [HTTPRequest](https://docs.godotengine.org/en/stable/classes/class_httprequest.html)

## Example

```
func download(link, path):
    var http = HTTPRequest.new()
    add_child(http)
    http.connect("request_completed", self, "_http_request_completed")

```

```auto
    http.set_download_file(path)
    var request = http.request(link)
    if request != OK:
        push_error("Http request error")

func _http_request_completed(result, _response_code, _headers, _body):
    if result != OK:
        push_error("Download Failed")
    remove_child($HTTPRequest)

func _ready():
    download("https://godotengine.org/themes/godotengine/assets/logo.svg", "Logo.svg")

```

---

_[View the full topic](https://forum.godotengine.org/t/how-to-download-files-from-the-internet-using-gdscript/8163)._
