I'm using LuaSocket and wanted to download files with it, but I do not know like, I was able to download text file like this:
local file = io.open("Blabla.txt", "w")
file:write(tostring(http.request("Http://pokestage.ddns.net/patch/News.txt")))
file:close()
io.write("Downloaded!\n")
io.read()
How could I download files from other formats? (Exe, rar ...)
@Edit: I tried:
arq = http.request("http://pokestage.ddns.net/patch/1.7z")
for ind, val in pairs(arq) do
print(ind)
end
Returned: Table expected, got string.
. But when I try to write, it still does not work.