title: Lua HTTP download and save to file
body: <p>I'm trying to download and then save the contents to a xml file. The code I got is: </p>
  
  <pre><code>local filePath = currentDir().."/file.xml"
  
  local http  = require("socket.http")
  local xFile = io.open(filePath, "w")
  local save = ltn12.sink.file(xFile)
  
  http.request{addr, sink = save }
  print("Done!")
  </code></pre>
  
  <p>It runs but the file is still empty. Can I get some help here please?</p>