Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3.  
  4. print("Download V0.2")
  5. print("Type name of file you want.")
  6. write("File: ")
  7. filename = read()
  8.  
  9. ip = "192.168.1.78" --Thomas PC
  10. resp = http.get("http://"..ip..":5000/"..filename)
  11.  
  12. data = resp.readAll()
  13. if data == "Error 404" then
  14. print("File '"..filename.."' not found on server.")
  15. else
  16. print("File found, saving.")
  17. if fs.exists(filename) then
  18. print("File Already Exists")
  19. else
  20. fw = fs.open(filename, "w")
  21. fw.write(data)
  22. fw.close()
  23. end
  24. end
  25.  
  26. -- print("end")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement