Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args={...}
- url = args[1]
- filename = args[2]
- h = http.get(url)
- if h then
- local content = h.readAll()
- h.close()
- local f = fs.open(filename, "w")
- f.write(content)
- f.close()
- print("Downloaded "..filename)
- else
- print("HTTP request failed")
- end
Advertisement
Add Comment
Please, Sign In to add comment