3 local cgi = require "cgi"
4 local fs = require "nixio.fs"
5 local luafm = require "luafm"
14 ret, msg = cgi.parse_request_body(req)
17 destfile=io.open(req.post["destination"][1]["tempname"],"r")
18 destination=destfile:read("*all")
20 for k, v in pairs(req.post) do
21 for j, v in pairs(req.post[k]) do
23 path = luafm.make_new_path(destination..'/'..v.filename)
25 fs.copy(req.post[k][j].tempname, path)
33 print('{ "result": { "success": true, "error": null } }')