mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-12-16 19:15:45 +00:00
Compare commits
No commits in common. "main" and "v1.1.2-beta" have entirely different histories.
main
...
v1.1.2-bet
1 changed files with 3 additions and 5 deletions
|
|
@ -19,8 +19,6 @@ if not http.checkURL(args[1]) then
|
||||||
error("Invalid URL", 0)
|
error("Invalid URL", 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
print("Connecting...")
|
|
||||||
|
|
||||||
local response, err = http.get(args[1], nil, {
|
local response, err = http.get(args[1], nil, {
|
||||||
binary = true,
|
binary = true,
|
||||||
})
|
})
|
||||||
|
|
@ -29,8 +27,8 @@ if not response then
|
||||||
end
|
end
|
||||||
|
|
||||||
local file <close> = fs.open(outputPath, "wb")
|
local file <close> = fs.open(outputPath, "wb")
|
||||||
file:write(response.content:read("a"))
|
file:write(response:readAll())
|
||||||
file:close()
|
file:close()
|
||||||
response.content:close()
|
response:close()
|
||||||
|
|
||||||
print("Downloaded to " .. outputPath)
|
print("File written to " .. outputPath)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue