Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- print("Download V0.2")
- print("Type name of file you want.")
- write("File: ")
- filename = read()
- ip = "192.168.1.78" --Thomas PC
- resp = http.get("http://"..ip..":5000/"..filename)
- data = resp.readAll()
- if data == "Error 404" then
- print("File '"..filename.."' not found on server.")
- else
- print("File found, saving.")
- if fs.exists(filename) then
- print("File Already Exists")
- else
- fw = fs.open(filename, "w")
- fw.write(data)
- fw.close()
- end
- end
- -- print("end")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement